Skip to content

Commit 7f70a8f

Browse files
committed
FIXUP: Use #mustBeBooleanMagicDoitForContext: intead of #asDoitForContext:
1 parent feb40fa commit 7f70a8f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

PreSmalltalks-Pharo8-Curry/BlockClosure.extension.st

+13-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BlockClosure >> value: anArg [
66
whose closure is the receiver and whose caller is the sender of this message.
77
Supply the argument and copied values to the activation as its arguments and copied temps.
88
Primitive. Optional (but you're going to want this for performance)."
9-
<primitive: 207>
9+
<primitive: 202>
1010
numArgs > 1 ifTrue:
1111
[^self curry: {anArg}].
1212
numArgs < 1 ifTrue:
@@ -20,7 +20,7 @@ BlockClosure >> value: firstArg value: secondArg [
2020
whose closure is the receiver and whose caller is the sender of this message.
2121
Supply the arguments and copied values to the activation as its arguments and copied temps.
2222
Primitive. Optional (but you're going to want this for performance)."
23-
<primitive: 207>
23+
<primitive: 203>
2424
numArgs > 2 ifTrue:
2525
[^self curry: {firstArg.secondArg}].
2626
numArgs < 2 ifTrue:
@@ -34,7 +34,7 @@ BlockClosure >> value: firstArg value: secondArg value: thirdArg [
3434
whose closure is the receiver and whose caller is the sender of this message.
3535
Supply the arguments and copied values to the activation as its arguments and copied temps.
3636
Primitive. Optional (but you're going to want this for performance)."
37-
<primitive: 207>
37+
<primitive: 204>
3838
numArgs > 3 ifTrue:
3939
[^self curry: {firstArg.secondArg.thirdArg}].
4040
numArgs < 3 ifTrue:
@@ -48,7 +48,7 @@ BlockClosure >> value: firstArg value: secondArg value: thirdArg value: fourthAr
4848
whose closure is the receiver and whose caller is the sender of this message.
4949
Supply the arguments and copied values to the activation as its arguments and copied temps.
5050
Primitive. Optional (but you're going to want this for performance)."
51-
<primitive: 207>
51+
<primitive: 205>
5252
numArgs > 4 ifTrue:
5353
[^self curry: {firstArg.secondArg.thirdArg.fourthArg}].
5454
numArgs < 4 ifTrue:
@@ -63,14 +63,17 @@ BlockClosure >> valueWithArguments: anArray [
6363
Supply the arguments in an anArray and copied values to the activation as its arguments and copied temps.
6464
Primitive. Optional (but you're going to want this for performance)."
6565
| newContext ncv |
66-
<primitive: 208>
66+
<primitive: 206>
6767
numArgs > anArray size ifTrue:
6868
[^self curry: anArray].
6969
numArgs < anArray size ifTrue:
7070
[^self uncurry: anArray].
71-
anArray isArray
72-
ifTrue: [self primitiveFailed]
73-
ifFalse: [
74-
"Retrying with an array as parameter. As the primitive only supports arrays"
75-
^ self valueWithArguments: anArray asArray ]
71+
newContext := self asContextWithSender: thisContext sender.
72+
ncv := self numCopiedValues.
73+
newContext stackp: ncv + numArgs.
74+
1 to: numArgs do:
75+
[:i| newContext at: i put: (anArray at: i)].
76+
1 to: ncv do:
77+
[:i| newContext at: i + numArgs put: (self at: i)].
78+
thisContext privSender: newContext
7679
]

0 commit comments

Comments
 (0)