HOM - Higher Order Messages

Blaine Buxton blainebuxton at hotmail.com
Wed Apr 19 03:44:32 UTC 2006


Hello,
I have a package on SqueakMap called "LazyCollections". The idea originally 
was to implement the common collection protcols to lazy evaluate. But, when 
I read the HOM paper, I decided to try it out. It turned out to be trivial 
to implement in "LazyCollections".

For an example, see LazyCollectionTest>>testIterator. The LazyIterator class 
is where the magic begins. I didn't implement everything in the HOM paper. I 
mainly did LazyCollections as an experiment. If you get anything out of it, 
please let me know.
------------------------------------------------
Blaine Buxton, Mad Scientist In Training
http://www.blainebuxton.com




>From: "Francisco Garau" <francisco.garau at gmail.com>
>Reply-To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>To: "Squeak List" <squeak-dev at lists.squeakfoundation.org>
>Subject: HOM - Higher Order Messages
>Date: Tue, 18 Apr 2006 22:25:40 +0100
>
>Hi,
>
>During our first UK Smalltalk meeting, Marcel Weiher presented the ideas 
>behind Higher Order Messages [1]. With them your collection code looks much 
>nicer. Compare:
>
>Without HOM:
>
>    #(1 2 3) collect: [:e | e + 1]
>    #(1 2 3) inject: 0 into: [:a :b | a + b]
>    #(1 2 3) addAll: #(4 5)
>
>With HOM:
>
>    #(1 2 3) collect + 1
>    #(1 2 3) reduce + 0
>    #(1 2 3) add: #(4 5) all
>
>Has anybody implemented them Squeak?
>Marcel mentioned a port to VW, but he also mentioned that it is quite easy 
>to implement.
>
>The APL guys at the meeting where very excited about the #reduce message 
>(which they denote by / ). They didn't like that you have to specifiy the 
>initial value. I think that with some double dispatching, we could avoid 
>having that initial value. We could have code like this: #(1 2 3) / +
>
>Cheers,
>Francisco
>
>[1] http://www.metaobject.com/papers/Higher_Order_Messaging_OOPSLA_2005.pdf
>
>

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/




More information about the Squeak-dev mailing list