From: Mariano Montone
Subject: Message passing syntax
Date: 
Message-ID: <1185243014.736901.132880@o61g2000hsh.googlegroups.com>
Hi,
   I'm trying to come up with a lispy syntax and translate that to
another language in order to take advantage of lisp metaprogramming
capabilities.
   The thing is the target language uses message-passing OO and I'm
not sure how to map that into my language.
   These are the options I'm considering:
   1) Use an explicit "send" function. I don't like it very much
though, as it may get too verbose.
       Example: (send other-message (send a-message obj)).
       Maybe use "->": (-> other-message (-> a-message obj))
   2) Use reader macros and try something like: ((obj->a-message)-
>other-message) or maybe ((obj->a-message).other-message)
      Translate those to: (send other-message (send a-message obj))
   3) Use a top calling macro and walk the code: (sending-messages
((obj a-message) other-message)).
      Forms have the following meaning: (object message &rest
arguments).
      One of the problems of this approach is that I need to use an
"escape" form when I want to do something different from message-
passing and treat special forms. Example: (sending-messages ((obj a-
message) other-message (without-messages (my-func 2))))

   Do you have any other alternatives?
   Which of these ones do you think is the best suited?

   Thank you,
             Mariano

From: Dan Bensen
Subject: Re: Message passing syntax
Date: 
Message-ID: <f840d3$oje$1@wildfire.prairienet.org>
Mariano Montone wrote:
>    1) Use an explicit "send" function. I don't like it very much
> though, as it may get too verbose.
>        Example: (send other-message (send a-message obj)).
>        Maybe use "->": (-> other-message (-> a-message obj))

I think Naughty Dog did this with GOAL.  There was some source code
online somewhere a few months ago, but I can't find it now.
The syntax was (-> object method arg1 arg2 ...).

-- 
Dan
www.prairienet.org/~dsb/
From: Matthias Buelow
Subject: Re: Message passing syntax
Date: 
Message-ID: <5gld4iF3h7o5eU1@mid.dfncis.de>
Mariano Montone wrote:

>    Do you have any other alternatives?
>    Which of these ones do you think is the best suited?

"send" is fine in my opinion.

Lisp is relatively verbose; trying to make it overly concise will make
it ugly, imho.

Another idea, however, could be using [] or {} or so for message
sending. Like [obj message] for (send obj message), or whatever argument
order you're going to use. Just an idea, I don't know if that will be
better.
From: Mark H.
Subject: Re: Message passing syntax
Date: 
Message-ID: <1185294149.963745.286420@d30g2000prg.googlegroups.com>
On Jul 23, 9:22 pm, Matthias Buelow <····@incubus.de> wrote:
> Another idea, however, could be using [] or {} or so for message
> sending. Like [obj message] for (send obj message), or whatever argument
> order you're going to use. Just an idea, I don't know if that will be
> better.

Square brackets [] are used by Objective C for message passing, so
some coders might be familiar with that syntax.

mfh
From: Rainer Joswig
Subject: Re: Message passing syntax
Date: 
Message-ID: <joswig-649CF3.08585324072007@news-europe.giganews.com>
In article <························@o61g2000hsh.googlegroups.com>,
 Mariano Montone <··············@gmail.com> wrote:

> Hi,
>    I'm trying to come up with a lispy syntax and translate that to
> another language in order to take advantage of lisp metaprogramming
> capabilities.
>    The thing is the target language uses message-passing OO and I'm
> not sure how to map that into my language.
>    These are the options I'm considering:
>    1) Use an explicit "send" function. I don't like it very much
> though, as it may get too verbose.
>        Example: (send other-message (send a-message obj)).
>        Maybe use "->": (-> other-message (-> a-message obj))
>    2) Use reader macros and try something like: ((obj->a-message)-
> >other-message) or maybe ((obj->a-message).other-message)
>       Translate those to: (send other-message (send a-message obj))
>    3) Use a top calling macro and walk the code: (sending-messages
> ((obj a-message) other-message)).
>       Forms have the following meaning: (object message &rest
> arguments).
>       One of the problems of this approach is that I need to use an
> "escape" form when I want to do something different from message-
> passing and treat special forms. Example: (sending-messages ((obj a-
> message) other-message (without-messages (my-func 2))))
> 
>    Do you have any other alternatives?
>    Which of these ones do you think is the best suited?
> 
>    Thank you,
>              Mariano

Look for Flavors
http://common-lisp.net/project/bknr/static/lmman/flavor.xml
(use Firefox (or similar) to view)
 and New Flavors.

-- 
http://lispm.dyndns.org
From: Andreas Davour
Subject: Re: Message passing syntax
Date: 
Message-ID: <cs9abtae2t0.fsf@Psilocybe.Update.UU.SE>
Rainer Joswig <······@lisp.de> writes:


> Look for Flavors
> http://common-lisp.net/project/bknr/static/lmman/flavor.xml
> (use Firefox (or similar) to view)
>  and New Flavors.

You don't have any recommended implementations as well, do you?

/Andreas

-- 
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: Rainer Joswig
Subject: Re: Message passing syntax
Date: 
Message-ID: <joswig-9D9EFA.11401702082007@news-europe.giganews.com>
In article <···············@Psilocybe.Update.UU.SE>,
 Andreas Davour <····@update.uu.se> wrote:

> Rainer Joswig <······@lisp.de> writes:
> 
> 
> > Look for Flavors
> > http://common-lisp.net/project/bknr/static/lmman/flavor.xml
> > (use Firefox (or similar) to view)
> >  and New Flavors.
> 
> You don't have any recommended implementations as well, do you?
> 
> /Andreas

I guess one does not really want Flavors, but something
that gives you some flavor of Flavors with CLOS.
Note that 'Flavors' uses message passing, where
'New Flavors' uses 'generic functions'. 

Allegro CL comes with Flavors.
http://www.franz.com/support/documentation/8.1/doc/flavors.htm

Genera comes with Flavors and New Flavors.

Artificial Flavors is hack for New Flavors (without SEND).
http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/oop/clos/code/0.html

This might be more interesting:
M(ITRE)U(niversity of)L(owell)-FLAVORS PACKAGE
http://www.cs.uml.edu/~giam/DPL/Code/mul-flavors.lisp

-- 
http://lispm.dyndns.org