BOOL Actor objects link to and invoke Action objects. An Actor Object is essentially the “instance” of an Action.
A BOOL Actor links to its Action via a shared name. Currently the linkage can be static or dynamic (the latter requiring some form of run-time binding of names).
The Action must be known at compile-time, because the arity must be known (and BOOL needs to know it can link to the Action). Actions can take zero or more parameters, so Actors have zero or more parameters to match.
Actor parameters are objects following the Actor object and having the same dot level. Because the arity is known, the compiler consumes however many following objects are required by the Actor.
@hypot 3 4 @if zero:ix @print Document @incr x
The basic algorithm for an Actor is:
Actor::HandleMessage (actor, message): action = GetObject(actor.action) action.invoke(actor.cplist) result = PStack.pop() CallFrame.set_value(actor.result, result) if message != 'X': SendMessage(actor.result, message)
The TEMP object associated with the TOR object acts as the code address for the Action’s result object. The last lines above pop that result from the stack and move it to the TEMP object and current Call Frame.
(TEMP, T_any, dx): @temp (TOR, name, clause-parameter-list, @temp)
The clause-parameter-list consists of clause objects, which each have the format:
The parameter(s) are zero or more parameters as specified by the clause definition of the Action.