Collection do: aMessage (was Re: (f value: n) <=> f{n})

Marcel Weiher marcel at metaobject.com
Wed Jul 12 14:42:07 UTC 2000


> I much prefer
>
>   #(2 4 6 8) do: #factorial
>
> So do I. Alas that means that every implementor of #do: aBlock  
would have to
> ask the argument to convert itself to a MonadicValuable (in ANSI  
parlance).
>
> ie. something like:
>
> #do: aMonadicValuable
>
> 	1 to: self size do:
> 		[ :i | aMonadicValuable asMonadicValuable value: (self 
> elementAt: i) ].

Why?  Why not simply implement Symbol>>value: ?   I think I even did  
that somewhere (as have others)..

Marcel





More information about the Squeak-dev mailing list