Messaging vs. subroutines (Re: Thinking about a better UI)

Patrick Logan patrickl at gemstone.com
Mon May 17 17:19:00 UTC 1999


agree at carltonfields.com writes:

 > > 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".)

 > As to this example, counterexamples abound.  For example, I note
 > that sending the message "open" or "openInMorphic" to a controller
 > or browser window in Smalltalk does not ordinarily return a result
 > and does not ordinarily raise an exception, unless you are defining
 > the failure to return a message as an exception.

As agree and I have discussed in private email, though, the behavior
of these methods is in the control of the receiver. The sender is
still anticipating a synchronous message send. It is up to the
receiver to decide when to return or whether to throw an exception (or
terminate the process).

In an asynchronous message passing scheme the sender sends a message
and goes on its merry way. The receiver is not going to receive the
message in the same process. Also the receiver can have more control
over the order it receives messages and when, if ever, it chooses to
receive any given message.

-- 
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