(1 to: self) inject: 1 into: #*

Andrew P. Black apb at cse.ogi.edu
Tue Jan 25 07:23:34 UTC 2000


I've only just caught up with this thread, which I found interesting, 
even though it now seems to have died down without anything really 
being resolved.

In my view, the fact that binary selectors can sometimes with some 
convenience be though of as two argument blocks, although most of the 
time they are very different, says that this is a perfect example of 
a good use for a conversion protocol.

For example:

	#* asBinaryBlock => [ :x :y | x * y ]
	#raisedToPower: asBinaryBlock => [ :x :y | x raisedToPower:  y]

This gives most of the concision of the original request, but 
maintains a clean distinction between blocks and symbols.

	Andrew





More information about the Squeak-dev mailing list