[squeak-dev] #valueWithPossibleArgument: vs. #cull:

Marcel Taeumel marcel.taeumel at hpi.de
Mon May 20 15:38:44 UTC 2019


Hi, there.

I think that all (6) sends in Trunk to #valueWithPossibleArgument: can be replaced with #cull:, which is more flexible.


Does anyone recall the story of #cull:? Maybe we should just implement #valueWithPossibleArgument: on MessageSend (and maybe Symbol) to make it more consistent?

For context, here is how I stumbled on it:
#(1 2 3) collect: #even. "Works." 
1 ifNotNil: #even. "Works."
#(1) ifNotEmpty: #first. "Does not work."

Please note that this question is not about "#(1 2 3) collect: #even" versus "#(1 2 3) collect: [:ea | ea even]". ;-) This is more like a case of surprising inconsistency...

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190520/181af140/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 20228 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190520/181af140/attachment.png>


More information about the Squeak-dev mailing list