Objectmix
Tags Register Mark Forums Read

HOM: Higher Order Messaging : Object

This is a discussion on HOM: Higher Order Messaging within the Object forums in Theory and Concepts category; Hi Can someone explain me on Higher Order Messaging and how it is used in Java? thanks Srinivas Ivaturi,...


Object Mix > Theory and Concepts > Object > HOM: Higher Order Messaging

Reply

 

LinkBack Thread Tools
  #1  
Old 10-20-2006, 03:01 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default HOM: Higher Order Messaging

Hi

Can someone explain me on Higher Order Messaging and how it is used in
Java?

thanks
Srinivas Ivaturi,

Reply With Quote
  #2  
Old 10-23-2006, 08:58 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: HOM: Higher Order Messaging

srini <srinivas.ivaturi{}> wrote:
> Can someone explain me on Higher Order Messaging and how it is used in
> Java?


Higher Order Messaging is defined as messages that take other messages
as arguments. In a way, it is the OO ****og to Higher Order Functions
in functional programming languages (but different, because messaging
is different from function invocation).

The most comprehensive treatment is probably my OOPSLA paper:

www.metaobject.com/papers/ Higher_Order_Messaging_OOPSLA_2005.pdf

However, you can find varied discussion on the web.

To the best of my knowledge, HOM is not used in Java at all. There
have been attempts to implement HOM in Java, but these run afoul
of Javas strict typing regime.

Marcel
Reply With Quote
  #3  
Old 10-25-2006, 04:27 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: HOM: Higher Order Messaging

Marcel Weiher wrote in news:4q404aFld6b0U1{}news.dfncis.de:
> Higher Order Messaging is defined as messages that take other
> messages as arguments. In a way, it is the OO ****og to Higher
> Order Functions in functional programming languages (but
> different, because messaging is different from function
> invocation).
>
> The most comprehensive treatment is probably my OOPSLA paper:
>
> http://www.metaobject.com/papers/Hig...OPSLA_2005.pdf


This is a very interesting subject. I am a fan of functional
programming and this seems to combine the best of both object
oriented programming and functional programming.

Unfortunately, the paper goes a bit fast for someone new to the
concept and unfamiliar with the syntax that is being use. I am
especially confused by the 'each' message that is used like this:

alice addReport: sally reports each

This is supposed to be equivalent to sending alice the addReport
message with every report that sally has. Is this an example of HOM?
If so, which is the higher-order message? 'each' does not seem to
take any arguments, so I presume that it is by definition not higher-
order. 'each' is supposed to 'wrap its receiver in special marker
object', but surely it is objects that take actions, not messages. So
in other words, the receiver is supposed to wrap itself in an object.
That seems impossible even with the magic of HOMs.

Even assuming that 'each' can wrap its receiver, what exactly is the
receiver in this case? Is it sally? Is it sally's reports?

What is the argument to addReport in this case? Is it sally? Is it an
iterator created by 'each'? Does the implementation of addReport need
to know how to handle this situation?

The existence of the selectWhere message suggests an interesting
limitation to the technique. selectWhere only works for two levels of
message passing, such as:

[[[employees selectWhere] name] isEqual: {}"John"]

Where the test for each employee is like this:
[[employee name] isEqual: {}"John"]

But suppose we want a test like this:
[[[employee spouse] name] isEqual: {}"John"]

Now selectWhere seems inadequate.

Instead of selectWhere, I would have expected higher-order messages
to have message compositions. For example, one might use '.' to be a
message composition operator and then

[[[employees selectWhere] name] isEqual: {}"John"]

could become:

[[employees select] name . isEqual: {}"John"]

And we can also do:

[[employees select] spouse . name . isEqual: {}"John"]
Reply With Quote
  #4  
Old 11-07-2006, 05:39 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: HOM: Higher Order Messaging

Brendan Guild <dont{}spam.me> wrote:
> Marcel Weiher wrote in news:4q404aFld6b0U1{}news.dfncis.de:
>> The most comprehensive treatment is probably my OOPSLA paper:
>>
>> http://www.metaobject.com/papers/Hig...OPSLA_2005.pdf


> Unfortunately, the paper goes a bit fast for someone new to the
> concept and unfamiliar with the syntax that is being use.


Sorry to hear that :-(

> I am
> especially confused by the 'each' message that is used like this:


> alice addReport: sally reports each


Ahh...that's a typo in that draft. It should be

alice do addReport: sally reports each.

Sorry for the confusion, I think it was fixed in the final version.


> The existence of the selectWhere message suggests an interesting
> limitation to the technique. selectWhere only works for two levels of
> message passing, such as:


> [[[employees selectWhere] name] isEqual: {}"John"]


> Where the test for each employee is like this:
> [[employee name] isEqual: {}"John"]


> But suppose we want a test like this:
> [[[employee spouse] name] isEqual: {}"John"]


> Now selectWhere seems inadequate.


Yes, this is a limitation of HOM as presented.

There are ways of working around this limitation, for example accumulating
messages until a trigger ('go' ?) is received. However, when you explore
that avenue, I think you will find a lot more that doesn't work out the
way you'd want...

> Instead of selectWhere, I would have expected higher-order messages
> to have message compositions. For example, one might use '.' to be a
> message composition operator and then


You can't do that without changing the language, and it also becomes
somewhat difficult to figure out what exactly refers to what.

Marcel
Reply With Quote
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
higher order functions usenet Functional 10 06-01-2007 05:41 PM
higher order function usenet ml 2 08-31-2006 02:59 PM
Higher order curves usenet Java-Games 12 05-15-2005 10:34 PM
Higher order curves usenet Graphics 6 05-15-2005 10:34 PM


All times are GMT -5. The time now is 07:53 PM.