Next: Meta-level Arguments
Up: The Meta-Level Architecture
Previous: The Meta-Level Architecture
Meta-interpreters of ABCL/R3 are meta-level objects that executes
body part of base-level methods and functions. Although these are
defined as objects, the definition looks like the traditional
meta-circular interpreters of Lisp, and those of sequential reflective
languages (e.g., 3-Lisp[15] and
Brown[17]).
The definition is divided into smaller methods, each of which
corresponds to a specific type of an expression.
Followings are part of the method definitions in the meta-interpreter:
- (eval-entry exp env)6:
- This method is called at the beginning of each base-level
method/function invocation. The argument exp is an unevaluated
expression of the method/function, and the argument env is an
environment, which binds instance variables of an object , and formal
parameters of a method/function. It simply calls the method
eval by default.
- (eval exp env):
- This method serves as a dispatcher--it calls an appropriate
sub-method (e.g., eval-var and eval-method-call) according
to the expression type.
- (eval-var var env):
- This method handles variable references--it returns value of the
variable in the environment.
- (eval-method-call exp env):
- This method handles method-invocation forms in base-level programs.
By default, (1) it first determines the invocation type (e.g., future
type or present type); and (2) it also determines the target object
(i.e., the receiver of the message), and the arguments by using the
method eval. (3) The ``meta-arguments'' of the invocation,
which is explained later, are determined by calling the method
meta-args. (4) Finally, it sends a invocation request to the target
object using the method do-method-call.
- (do-method-call type target selector args
meta-args env):
- This method actually sends a message to the target object. Firstly, a
data structure which has all the information for the invocation (e.g.,
method name and arguments) is composed by the method
make-message; and then the created data is passed by calling the
method message of the meta-object of the target.
The extensions are
written using delegation, so that meta-level description are
re-usable.7
Next: Meta-level Arguments
Up: The Meta-Level Architecture
Previous: The Meta-Level Architecture
Matt Hurlbut
1998-07-14