cull: equivalent for valueWithArguments:
Hi guys What would be cull: equivalent for valueWithArguments:? I need to be able to specify an extra argument to valueWithArguments valueWithArgument:cull:? Stef
On 22 Nov 2014, at 20:50, stepharo <stepharo@free.fr> wrote:
Hi guys
What would be cull: equivalent for valueWithArguments:?
I need to be able to specify an extra argument to valueWithArguments valueWithArgument:cull:?
Stef
The different variants/counts of #cull: come down to specifying one to four arguments to block evaluation/execution where the actual arguments (the count of them) is defined by the block, right ? So I think it should be #cullWithArguments: where the number actually used is defined by the number accepted by the block. I see that we already have #valueWithEnoughArguments: [ :x :y | { x. y } ] valueWithEnoughArguments: #( 1 2 ). => #(1 2) [ :x | { x } ] valueWithEnoughArguments: #( 1 2 ). => #(1) [ ] valueWithEnoughArguments: #( 1 2 ). => nil Which seems to do the same thing. Sven
thanks sven I will digest that. One day I will have to avoid using block in my tiny language exercise. Stef Le 22/11/14 21:03, Sven Van Caekenberghe a écrit :
On 22 Nov 2014, at 20:50, stepharo <stepharo@free.fr> wrote:
Hi guys
What would be cull: equivalent for valueWithArguments:?
I need to be able to specify an extra argument to valueWithArguments valueWithArgument:cull:?
Stef The different variants/counts of #cull: come down to specifying one to four arguments to block evaluation/execution where the actual arguments (the count of them) is defined by the block, right ?
So I think it should be #cullWithArguments: where the number actually used is defined by the number accepted by the block.
I see that we already have #valueWithEnoughArguments:
[ :x :y | { x. y } ] valueWithEnoughArguments: #( 1 2 ). => #(1 2)
[ :x | { x } ] valueWithEnoughArguments: #( 1 2 ). => #(1)
[ ] valueWithEnoughArguments: #( 1 2 ). => nil
Which seems to do the same thing.
Sven
participants (2)
-
stepharo -
Sven Van Caekenberghe