Messaging vs. subroutines (Re: Thinking about a better UI)
Patrick Logan
patrickl at gemstone.com
Mon May 17 16:02:00 UTC 1999
Marcel Weiher writes:
> > Well, a coroutine has some similarities, but it's purpose is
> > quite different, so I consider them different.
>
> Well, good. My claim is that messaging encompasses both
> subroutines and coroutines. Therefore, messaging is broader than
> subroutines. QED.
A message in Smalltalk (the current Smalltalks, anyway) returns
values, so from the perspective of the sender this is like a
"subroutine". The sender does not know how the value will be computed,
but the sender does know a value will be returned even if it is just
the reference to the receiver. (Or there will be an "exception".)
OTOH an asynchronous message send could be more general. There may or
may not be a response some time later. The response may or may not
come from the receiver and it may or may not go to the sender. This is
more general because it can be used to build the more restrictive
mechanism, not vice versa.
Take a look at http://www.erlang.org for a simple language that has
this kind of message passing.
--
Patrick Logan mailto:patrickl at gemstone.com
Voice 503-533-3365 Fax 503-629-8556
Gemstone Systems, Inc http://www.gemstone.com
More information about the Squeak-dev
mailing list
|