binary selectors ambiguity and space
duncanmak at gmail.com
Wed May 17 17:16:55 UTC 2006
On 5/17/06, nicolas cellier <ncellier at ifrance.com> wrote:
> You can simulate this count++ like with an indirection (a special ValueHolder
> subclass Counter) send the #increment message or whatever to the Counter, and
> then retrieve its value, but i don't know if this is interesting, apart
> sharing a common value between multiple objects
Yeah, that's what I did (not exactly that, but close enough). I was
just hoping that there's a standard pre-packaged solution to this,
other than rolling my own.
> names count: [:each | each startsWith: 'a']
> is even more efficient (does not create a copy of the collection)
Ah fun. Learn something new every day. Thanks!
More information about the Squeak-dev