HOM - Higher Order Messages

Francisco Garau francisco.garau at gmail.com
Wed Apr 19 07:18:24 UTC 2006


Craig said:
> "Those are neat, but I find the originals more readable (especially for 
> newcomers)"

But you are not a newcomer!! How do you know they are more readable?

In Marcel's paper, there is some justification as to why the code with HOM 
is more readable. Without HOM, you have explicit iteration and when reading 
such expressions, you are forced to jump between two layers of abstractions. 
You have to think about the collection and about the elements of the 
collection. Too bad.

Taking the example of Marcel and Stef's paper, if Sally and Alice are two 
objects representing a manager with its employees, and Sally leaves the 
company, we need to add Sally's reports to Alice's. Your code would look 
like:

    sally reports do: [ :each | alice addReport:each ]

The main subject of this expression (Alice) is now in the middle. You 
mentally jump inside and outside of the block. Of course, experienced 
Smalltalkers do this without noticing. But it would be more natural to 
express the same thing with HOM:

    alice addReport: sally reports all

Beautiful, isn't it?

-Francisco

----- Original Message ----- 
From: "Craig Latta" <craig at netjam.org>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Tuesday, April 18, 2006 11:47 PM
Subject: Re: HOM - Higher Order Messages


>
>
>
> -C
>
> p.s.
>
> I'm enjoying stuff like "18 April 2006" a lot more. :)  Quoth is full of 
> things like that (e.g., "1 second, 3rd g sharp, 60 percent volume, 2nd 
> channel").
>
> -- 
> Craig Latta
> improvisational musical informaticist
> www.netjam.org
> Smalltalkers do: [:it | All with: Class, (And love: it)]
>
>
> 




More information about the Squeak-dev mailing list