join

Ramon Leon ramon.leon at allresnet.com
Tue Sep 19 23:46:29 UTC 2006


> 1 to: 10 do: [:b ].
> I think your version might look like something from another 
> thread on squeak-dev at the moment. ACollection>>from:to:apply:

Nope, my version would be implemented just like it already is, to: on number
and do: on interval.

> 
> In this case Number>>to:do: is implemented on Number as 
> syntactic sugar onto Interval>>do: which actually does the work.

Which is how I'd think of it, to: belongs on number, do: belongs on
interval, to:do: is just a shortcut to the common case so you don't have to
put parens to disambiguate the statement.

> I think that it is relatively common to have classes that are 
> not the actual data holder doing the work. This is primarily 
> because of the power of the Smalltalk collections and their iterators.
> 
> best regards
> 
> Keith

I think it's common to have shortcuts that make it appear so, but having
classes that hold the data do the work, is a fundamental concept of object
orientation, this case is no different.




More information about the Squeak-dev mailing list