--- a/Behavior.st Wed Oct 11 14:33:30 2017 +0200
+++ b/Behavior.st Wed Oct 11 15:55:36 2017 +0200
@@ -400,9 +400,9 @@
flagBlock
"return the flag code which marks Block-like instances.
- The VM checks for either this bit or the blockLike bit in the flag
- value when checking for blocks to be evaluated from bytecodes.
- However, compiled code only checks for the block bit."
+ The VM and compiled code check for this bit in the flag
+ value when checking for blocks to be evaluated from bytecode
+ or calling the block's code immediately."
%{ /* NOCONTEXT */
/* this is defined as a primitive to get defines from stc.h */
@@ -431,20 +431,17 @@
%}
!
-flagBlockLike
- "return the flag code which marks Block-like instances
- with respect to byteCode interpretation.
- The VM checks for either this bit or the block bit in the flag
- value when checking for blocks to be evaluated from bytecodes.
- However, compiled code only checks for the block bit."
+flagVarArgBlock
+ "return the flag code which marks varArg Block-like instances
+ with respect to byteCode interpretation & code calling."
%{ /* NOCONTEXT */
/* this is defined as a primitive to get defines from stc.h */
#ifdef __SCHTEAM__
- return __c__._RETURN( STClass.FLAG_BLOCKLIKE_INSTS );
+ return __c__._RETURN( STClass.FLAG_VARARGBLOCK_INSTS );
#else
- RETURN ( __mkSmallInteger(BLOCKLIKE_INSTS) );
+ RETURN ( __mkSmallInteger(VARARGBLOCK_INSTS) );
#endif
%}
!
@@ -1342,7 +1339,7 @@
theMetaClass
<resource: #obsolete>
-
+
"alias for theMetaclass (Squeak) - return the class.
sigh; in ST/X, it is called theMetaclass; please use that."
@@ -1353,7 +1350,7 @@
theNonMetaClass
<resource: #obsolete>
-
+
"alias for theNonMetaclass (Squeak) - return the class.
sigh; in ST/X, it is called theNonMetaclass; please use that."
@@ -1458,30 +1455,30 @@
|oldMethod ns nsName selector newLookupObject|
(newSelector isMemberOf:Symbol) ifFalse:[
- self error:'invalid selector'.
+ self error:'invalid selector'.
].
ns := newMethod nameSpace.
(ns notNil and:[(nsName := ns name) ~= self programmingLanguage defaultSelectorNameSpacePrefix]) ifTrue:[
- selector := (':' , nsName , '::' , newSelector) asSymbol.
- newLookupObject := Smalltalk at: #NamespaceAwareLookup. "/ so it can be nilled to disable that feature
+ selector := (':' , nsName , '::' , newSelector) asSymbol.
+ newLookupObject := Smalltalk at: #NamespaceAwareLookup. "/ so it can be nilled to disable that feature
] ifFalse:[
- selector := newSelector
+ selector := newSelector
].
"/ Q (cg): isn't that something that the caller should decide?
oldMethod := self compiledMethodAt:selector.
oldMethod notNil ifTrue:[
- newMethod restricted:(oldMethod isRestricted).
- newMethod setPrivacy:(oldMethod privacy) flushCaches:false.
+ newMethod restricted:(oldMethod isRestricted).
+ newMethod setPrivacy:(oldMethod privacy) flushCaches:false.
].
(self primAddSelector:selector withMethod:newMethod) ifFalse:[^ false].
newLookupObject notNil ifTrue:[
- lookupObject ~= newLookupObject ifTrue:[
- self lookupObject: newLookupObject
- ]
+ lookupObject ~= newLookupObject ifTrue:[
+ self lookupObject: newLookupObject
+ ]
].
"
@@ -1491,12 +1488,12 @@
"
"
problem: this is slower; since looking for all subclasses is (currently)
- a bit slow :-(
- We need the hasSubclasses-info bit in Behavior; now
+ a bit slow :-(
+ We need the hasSubclasses-info bit in Behavior; now
self withAllSubclassesDo:[:aClass |
- ObjectMemory flushInlineCachesFor:aClass withArgs:nargs.
- ObjectMemory flushMethodCacheFor:aClass
+ ObjectMemory flushInlineCachesFor:aClass withArgs:nargs.
+ ObjectMemory flushMethodCacheFor:aClass
].
"
@@ -2142,8 +2139,8 @@
However, within one inheritance level, there is no specific order,
in which the entries are enumerated.
Warning:
- This will only enumerate globally known classes - for anonymous
- behaviors, you have to walk over all instances of Behavior."
+ This will only enumerate globally known classes - for anonymous
+ behaviors, you have to walk over all instances of Behavior."
|meta toDo cls|
@@ -2151,13 +2148,13 @@
toDo := self theNonMetaclass subclasses asNewOrderedCollection.
[toDo notEmpty] whileTrue:[
- cls := toDo removeFirst.
- toDo addAll:cls subclasses.
- meta ifTrue:[
- aBlock value:cls class.
- ] ifFalse:[
- aBlock value:cls.
- ]
+ cls := toDo removeFirst.
+ toDo addAll:cls subclasses.
+ meta ifTrue:[
+ aBlock value:cls class.
+ ] ifFalse:[
+ aBlock value:cls.
+ ]
].
"/ self isMeta ifTrue:[
@@ -2981,13 +2978,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|
@@ -3010,16 +3007,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 value].
- ((newObject class == self) or:[newObject isKindOf:self])
- ifTrue:[newObject]
- ifFalse:[exceptionBlock value].
+ |newObject|
+
+ newObject := self evaluatorClass evaluateFrom:aStream ifFail:[^ exceptionBlock value].
+ ((newObject class == self) or:[newObject isKindOf:self])
+ ifTrue:[newObject]
+ ifFalse:[exceptionBlock value].
] on:Error do:exceptionBlock.
"
@@ -3027,7 +3024,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'
)
"
"
@@ -3035,7 +3032,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'
)
"
"
@@ -3184,7 +3181,7 @@
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
"/ old ST80 means: draw-yourself on a GC.
(aGCOrStream isStream) ifFalse:[
- ^ super displayOn:aGCOrStream
+ ^ super displayOn:aGCOrStream
].
aGCOrStream nextPutAll:self name
@@ -4122,7 +4119,7 @@
coll := OrderedCollection new.
self allInstancesForWhich:predicate do:[:someObject | coll add:someObject].
^ coll
-
+
"
ScrollBar allInstancesSelect:[:s | s shown]
"
@@ -4842,14 +4839,14 @@
This is semantically equivalent to includesSelector: (which is ST/80/Squeak compatibility).
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).
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."
^ self includesSelector:aSelector
@@ -5362,4 +5359,3 @@
version_CVS
^ '$Header$'
! !
-
--- a/VarArgBlock.st Wed Oct 11 14:33:30 2017 +0200
+++ b/VarArgBlock.st Wed Oct 11 15:55:36 2017 +0200
@@ -46,34 +46,34 @@
Create a variableArgument block by sending #asVarArgBlock to a regular
block.
- This is a goody add-on, which may not be available/possible in other
+ This is a goody add-on, which may not be available/possible in other
smalltalk implementations. Do not use it if cross-platform
portability is required.
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- Block
+ Block
"
!
examples
"
the same block, evaluated with 2 or 5 arguments:
- [exBegin]
+ [exBegin]
|b|
b := [:args | Transcript show:'wow: '; showCR:args] asVarArgBlock.
- b value:'hi' value:'there'.
+ b value:'hi' value:'there'.
b value:'hello' value:'there' value:'how' value:'about' value:'this'.
- [exEnd]
+ [exEnd]
does it accept a variable number of arguments ?:
- [exBegin]
+ [exBegin]
|b|
b := [:args | Transcript showCR:args].
@@ -81,7 +81,7 @@
b := [:args | Transcript showCR:args] asVarArgBlock.
Transcript showCR:(b isVarArgBlock)
- [exEnd]
+ [exEnd]
"
"Created: 23.1.1997 / 04:57:26 / cg"
@@ -95,15 +95,15 @@
|newFlags|
- newFlags := (self flags
- bitClear:(Behavior flagBlock))
- bitOr:(Behavior flagBlockLike).
+ newFlags := (self flags
+ bitClear:(Behavior flagBlock))
+ bitOr:(Behavior flagVarArgBlock).
self flags:newFlags.
"
- self flags.
+ self flags.
self initialize.
- self flags.
+ self flags.
"
! !
@@ -144,10 +144,10 @@
value:arg1 value:arg2 value:arg3 value:arg4
"evaluate the receiver with four arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4)
"Modified: 22.1.1997 / 19:41:22 / cg"
@@ -157,10 +157,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5
"evaluate the receiver with five arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5)
@@ -171,10 +171,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6
"evaluate the receiver with six arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6)
@@ -186,10 +186,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7
"evaluate the receiver with seven arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6
@@ -202,10 +202,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7 value:arg8
"evaluate the receiver with eight arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6
@@ -236,7 +236,7 @@
!VarArgBlock class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/VarArgBlock.st,v 1.8 2013-04-16 12:44:14 cg Exp $'
+ ^ '$Header$'
! !
--- a/VarArgCheapBlock.st Wed Oct 11 14:33:30 2017 +0200
+++ b/VarArgCheapBlock.st Wed Oct 11 15:55:36 2017 +0200
@@ -45,10 +45,10 @@
read the documentation in VarArgBlock.
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- VarArgBlock Block CheapBlock
+ VarArgBlock Block CheapBlock
"
! !
@@ -60,15 +60,15 @@
|newFlags|
- newFlags := (self flags
- bitClear:(Behavior flagBlock))
- bitOr:(Behavior flagBlockLike).
+ newFlags := (self flags
+ bitClear:(Behavior flagBlock))
+ bitOr:(Behavior flagVarArgBlock).
self flags:newFlags.
"
- self flags.
+ self flags.
self initialize.
- self flags.
+ self flags.
"
! !
@@ -109,10 +109,10 @@
value:arg1 value:arg2 value:arg3 value:arg4
"evaluate the receiver with four arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4)
"Modified: 22.1.1997 / 19:41:22 / cg"
@@ -122,10 +122,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5
"evaluate the receiver with five arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5)
@@ -136,10 +136,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6
"evaluate the receiver with six arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6)
@@ -151,10 +151,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7
"evaluate the receiver with seven arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6
@@ -167,10 +167,10 @@
value:arg1 value:arg2 value:arg3 value:arg4 value:arg5 value:arg6 value:arg7 value:arg8
"evaluate the receiver with eight arguments."
- ^ super value:(Array
- with:arg1
- with:arg2
- with:arg3
+ ^ super value:(Array
+ with:arg1
+ with:arg2
+ with:arg3
with:arg4
with:arg5
with:arg6