[Pharo-project] cull: protocol

Stéphane Ducasse stephane.ducasse at inria.fr
Thu Feb 18 15:55:41 EST 2010


henrik 

I'm trying to get the pros and cons of cull:
So am'I correct that this is useful only for situation where we have a block and we do not know
upfront its number of argument: = places where valueWithPossibleArgs: 
Now what cull: offers is that the client does not have to create the array.

 I did not check your implementation.

Stef



On Feb 18, 2010, at 2:23 PM, Henrik Johansen wrote:

> Refactoring the AXAnnouncements abit so there's no separate classes for
> 0-, 1-, and 2-arg blocks, and really missing these methods from
> VisualWorks...
> cull: is equivalent to value: protocol except they accept block with N
> or less blockArgs
> Yes, I know valueWithEnoughArguments:/valueWithPossibleArgs: provide the
> same functionality, but the code looks much less nice using them, you
> end up constructing arrays needlessly etc.
> Look at the senders of valueWithPossibleArgs: for examples, very few of
> those actually need the ability to accept blocks with more arguments
> than they provide, and would also look nicer with cull:.
> 
> Would anyone object strongly to adding the cull:, cull:cull: methods in
> core instead of putting them as extension methods?
> 
> Cheers,
> Henry
> 
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project





More information about the Pharo-dev mailing list