class: Block
authorClaus Gittinger <cg@exept.de>
Mon, 15 Apr 2013 16:39:12 +0200
changeset 15089 f632280a4955
parent 15088 70454bb2fde9
child 15090 74303e1d9ac0
class: Block added: #cull: #cull:cull:cull: changed: #cull:cull:
Block.st
--- a/Block.st	Mon Apr 15 16:36:28 2013 +0200
+++ b/Block.st	Mon Apr 15 16:39:12 2013 +0200
@@ -490,8 +490,30 @@
 
 !Block methodsFor:'Compatibility-Squeak'!
 
+cull: firstArg 
+    "activate the receiver with one or zero arguments"
+
+    nargs >= 1 ifTrue:[^ self value:firstArg].
+    ^ self value
+!
+
 cull: firstArg cull: secondArg
-    nargs >= 2 ifTrue:[^ self value:firstArg value: secondArg].
+    "activate the receiver with two or less arguments"
+
+    nargs >= 2 ifTrue:[^ self value:firstArg value:secondArg].
+    nargs = 1 ifTrue:[^ self value:firstArg].
+    ^ self value
+!
+
+cull: firstArg cull: secondArg cull: thirdArg
+    "activate the receiver with three or less arguments"
+
+    nargs >= 2 ifTrue:[
+        nargs >= 3 ifTrue:[
+            ^ self value:firstArg value:secondArg value:thirdArg
+        ].
+        ^ self value:firstArg value:secondArg
+    ].
     nargs = 1 ifTrue:[^ self value:firstArg].
     ^ self value
 !
@@ -3091,11 +3113,11 @@
 !Block class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.192 2013-04-15 14:36:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.193 2013-04-15 14:39:12 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.192 2013-04-15 14:36:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Block.st,v 1.193 2013-04-15 14:39:12 cg Exp $'
 ! !