--- a/Behavior.st Mon Jun 06 10:37:21 2016 +0100
+++ b/Behavior.st Mon Jun 06 10:56:12 2016 +0100
@@ -14,7 +14,8 @@
"{ NameSpace: Smalltalk }"
Object subclass:#Behavior
- instanceVariableNames:'superclass flags methodDictionary lookupObject instSize'
+ instanceVariableNames:'superclass flags methodDictionary
+ lookupObject instSize'
classVariableNames:''
poolDictionaries:''
category:'Kernel-Classes'
@@ -50,10 +51,10 @@
Behavior provides minimum support for all class-like objects, which define behavior
- of other objects. Additional stuff (meta info) is found in ClassDescription and Class.
- Behavior provides all mechanisms needed to create instances (on the class side),
- and send messages to them.
- However, Behavior does not provide the (symbolic) information needed to compile methods
+ of other objects. Additional stuff (meta info) is found in ClassDescription and Class.
+ Behavior provides all mechanisms needed to create instances (on the class side),
+ and send messages to them.
+ However, Behavior does not provide the (symbolic) information needed to compile methods
for a class or to get useful information in inspectors or browsers.
For experts:
@@ -71,25 +72,25 @@
[Instance variables:]
- superclass <Class> the classes superclass
-
- methodDictionary <MethodDictionary> inst-selectors and methods
-
- instSize <SmallInteger> the number of instance variables
-
- flags <SmallInteger> special flag bits coded in a number
- not for application use
+ superclass <Class> the classes superclass
+
+ methodDictionary <MethodDictionary> inst-selectors and methods
+
+ instSize <SmallInteger> the number of instance variables
+
+ flags <SmallInteger> special flag bits coded in a number
+ not for application use
flag bits (see stc.h):
NOTICE: layout known by compiler and runtime system; be careful when changing
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- Class ClassDescription Metaclass
- Method MethodDictionary
+ Class ClassDescription Metaclass
+ Method MethodDictionary
"
!
@@ -2670,10 +2671,10 @@
goto nilIt;
# else
op = __InstPtr(newobj)->i_instvars;
- while (nInstVars-- != 0)
+ while (nInstVars-- != 0)
*op++ = nil;
fp = (float *)op;
- while (nindexedinstvars-- != 0)
+ while (nindexedinstvars-- != 0)
*fp++ = 0.0;
# endif
RETURN ( newobj );
@@ -2700,7 +2701,7 @@
goto nilIt;
# else
op = __InstPtr(newobj)->i_instvars;
- while (nInstVars-- != 0)
+ while (nInstVars-- != 0)
*op++ = nil;
# ifdef __NEED_DOUBLE_ALIGN
@@ -2713,7 +2714,7 @@
}
# endif
dp = (double *)op;
- while (nindexedinstvars-- != 0)
+ while (nindexedinstvars-- != 0)
*dp++ = 0.0;
# endif
RETURN ( newobj );
@@ -2756,7 +2757,7 @@
nInstVars -= 8;
}
}
- while (nInstVars != 0) {
+ while (nInstVars != 0) {
*op++ = 0;
nInstVars--;
}
@@ -2775,7 +2776,7 @@
nInstVars -= 8;
}
}
- while (nInstVars != 0) {
+ while (nInstVars != 0) {
*op++ = 0;
nInstVars--;
}
@@ -2792,7 +2793,7 @@
op[6] = nil; op[7] = nil;
op += 8;
}
- while (nInstVars-- != 0)
+ while (nInstVars-- != 0)
*op++ = nil;
# endif
# endif
@@ -2830,7 +2831,7 @@
op = __InstPtr(newobj)->i_instvars;
do {
*op++ = nil;
- } while (--nInstVars != 0);
+ } while (--nInstVars != 0);
# endif
# endif
}
@@ -2939,13 +2940,13 @@
This is the reverse operation to 'storeOn:'.
WARNING: storeOn: does not handle circular references and multiple
- references to the same object.
- Use #storeBinary:/readBinaryFrom: for this."
+ references to the same object.
+ Use #storeBinary:/readBinaryFrom: for this."
^ self
- readFrom:aStream
- onError:[ self conversionErrorSignal
- raiseWith:aStream errorString:' for: ' , self name ]
+ readFrom:aStream
+ onError:[ self conversionErrorSignal
+ raiseWith:aStream errorString:' for: ' , self name ]
"
|s|
@@ -2966,16 +2967,16 @@
This is the reverse operation to 'storeOn:'.
WARNING: storeOn: does not handle circular references and multiple
- references to the same object.
- Use #storeBinary:/readBinaryFrom: for this."
+ references to the same object.
+ Use #storeBinary:/readBinaryFrom: for this."
^ [
- |newObject|
-
- newObject := self evaluatorClass evaluateFrom:aStream ifFail:exceptionBlock.
- ((newObject class == self) or:[newObject isKindOf:self])
- ifTrue:[newObject]
- ifFalse:[exceptionBlock value].
+ |newObject|
+
+ newObject := self evaluatorClass evaluateFrom:aStream ifFail:exceptionBlock.
+ ((newObject class == self) or:[newObject isKindOf:self])
+ ifTrue:[newObject]
+ ifFalse:[exceptionBlock value].
] on:Error do:exceptionBlock.
"
@@ -2983,7 +2984,7 @@
s := WriteStream on:String new.
#(1 2 3 4) storeOn:s.
Transcript showCR:(
- Array readFrom:(ReadStream on:s contents) onError:'not an Array'
+ Array readFrom:(ReadStream on:s contents) onError:'not an Array'
)
"
"
@@ -2991,7 +2992,7 @@
s := WriteStream on:String new.
#[1 2 3 4] storeOn:s.
Transcript showCR:(
- Array readFrom:(ReadStream on:s contents) onError:'not an Array'
+ Array readFrom:(ReadStream on:s contents) onError:'not an Array'
)
"
"
@@ -3009,10 +3010,10 @@
Behavior>>readFrom: and Behavior>>readFrom:onError:"
^ self
- readFromString:aString
+ readFromString:aString
onError:[
- self conversionErrorSignal raiseWith:aString errorString:' - expected: ' , self name
- ]
+ self conversionErrorSignal raiseWith:aString errorString:' - expected: ' , self name
+ ]
"
Integer readFromString:'12345678901234567890'
@@ -3490,7 +3491,7 @@
Usually, this means that it only provides shared protocol for its
subclasses, which should be used.
Notice: this does not have any semantic effect;
- it is purely for the browser (shows an 'A'-Indicator)
+ it is purely for the browser (shows an 'A'-Indicator)
and for documentation.
To enforce abstractness, a subclass should redefine new, to raise an exception.
(which some do, but many are too lazy to do)"
@@ -4616,7 +4617,7 @@
"return true, if the receiver or one of its superclasses implements aSelector.
(i.e. true if my instances understand aSelector).
I think this is a bad name (it sounds more like instance protocol,
- and something like #instancesRespondTo: would have been better),
+ and something like #instancesRespondTo: would have been better),
but well, we are compatible (sigh)."
^ (self lookupMethodFor:aSelector) notNil
@@ -4801,14 +4802,14 @@
This is semantically equivalent to implements: (ST/80/Squeak compatibility).
Hint:
- Don't use this method to check if someone responds to a message -
- use #canUnderstand: on the class or #respondsTo: on the instance
- to do this.
+ Don't use this method to check if someone responds to a message -
+ use #canUnderstand: on the class or #respondsTo: on the instance
+ to do this.
Caveat:
- This simply checks for the selector being present in the classes
- selector table - therefore, it does not care for ignoredMethods.
- (but: you should not use this method for protocol-testing, anyway)."
+ This simply checks for the selector being present in the classes
+ selector table - therefore, it does not care for ignoredMethods.
+ (but: you should not use this method for protocol-testing, anyway)."
^ methodDictionary includesIdenticalKey:aSelector
@@ -5169,12 +5170,12 @@
|setOfSelectors|
self methodDictionary keysAndValuesDo:[:sel :mthd |
- (mthd referencesLiteral:someLiteralConstant) ifTrue:[
- setOfSelectors isNil ifTrue:[
- setOfSelectors := IdentitySet new.
- ].
- setOfSelectors add:sel
- ].
+ (mthd referencesLiteral:someLiteralConstant) ifTrue:[
+ setOfSelectors isNil ifTrue:[
+ setOfSelectors := IdentitySet new.
+ ].
+ setOfSelectors add:sel
+ ].
].
^ setOfSelectors ? #()
@@ -5277,4 +5278,3 @@
version_CVS
^ '$Header$'
! !
-