edu.vub.at.objects
Interface Message

All Known Subinterfaces:
AsyncMessage, FieldSelection, MethodInvocation

 Message

ATMessage represents a first-class AmbientTalk asynchronous message.

Asynchronous messages may be created explicitly using the <-m(args) syntax, or implicitly during an asynchronous message send of the form o<-m(args). This interface has not to be confused with the MessageCreation interface in the grammar subpackage. That interface represents an abstract grammar object representing the syntax tree of message creation. This interface is the interface to the actual runtime message object.

Author:
tvcutsem

Method Summary
 Nil arguments:=(Table arguments)
          Assigns the arguments passed of a first class method.
 Table arguments()
          Returns the arguments passed to the invocation, if any.
 Closure from(Object sender)
          Turns the receiver message into a unary closure that, when applied to a receiver object, sends the message to the receiver object, where the sender used is the object passed to from.
 Symbol selector()
          Returns the selector of message.
 Object sendTo(Object receiver, Object sender)
          Sends this message to a particular receiver object.
 
Methods inherited from interface edu.vub.at.objects.Object
super
 

Method Detail

selector

Symbol selector()
Returns the selector of message.

Messages always have a selector, a symbol denoting the field or method that needs to be sought for.

Returns:
an Symbol denoting the selector

arguments

Table arguments()
Returns the arguments passed to the invocation, if any.

Messages may optionally have a table of arguments.

Returns:
an Table containing the arguments passed to the invocation.

arguments:=

Nil arguments:=(Table arguments)
Assigns the arguments passed of a first class method.

Parameters:
arguments - a table containing the arguments to be assigned.
Returns:
nil

from

Closure from(Object sender)
Turns the receiver message into a unary closure that, when applied to a receiver object, sends the message to the receiver object, where the sender used is the object passed to from.

Parameters:
sender - the object designating the sender of any message sent via the closure
Returns:
a unary closure that accepts a receiver object and sends the message to the receiver

sendTo

Object sendTo(Object receiver,
              Object sender)
Sends this message to a particular receiver object. The way in which the message send will be performed (synchronous or asynchronous) depends on the kind of message.

Parameters:
receiver - the object receiving the message denoted by this ATMessage.
sender - the object sending the message denoted by this ATMessage.
Returns:
the Object representing the value of the method invocation or message send.
Throws:
edu.vub.at.exceptions.InterpreterException - if the method is not found or an error occurs while processing the method.