[squeak-dev] #in: for collections

Randal L. Schwartz merlyn at stonehenge.com
Sat Dec 26 16:27:05 UTC 2009

>>>>> "Bert" == Bert Freudenberg <bert at freudenbergs.de> writes:

Bert> ... however, #in: only works with single-argument blocks. Making #in:
Bert> work with multi-arg blocks is of course possible but feels not right
Bert> either. Does anybody have an idea for a better selector? Or another idea
Bert> for how to code this?

paralleling "with:" vs "withAll:" and "add:" vs "addAll:", I'd vote
for the slightly clumsy #allIn: or #inAll:

Collection >> #inAll: aBlock
  aBlock #valueWithPossibleArgs: self

If #valueWithPossibleArgs: requires specifically an Array, there might
need to be one definition for arrays, and another for Collections
that call #asArray.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Squeak-dev mailing list