ERights Home enative 
Back to: ENative: Compiling Variables x On to: ENative: Compiling Expressions

Compiling Objects


Not yet written

The Object Definition Expression

"def" param :: auditors "{" methods* optMatcher? "}"

Define param to be an object that responds to messages by the Miranda methods as overriden or suplemented by the provided methods and optional matcher

Each auditor must be bound to a "global" final variable, ie, a read-only variable in the incoming scope for evaluating the overall expression.  The value of this variable is read once and its value is asked to audit the parse tree of the ObjectExpr or PlumbingExpr it is being asked to audit.  Only if all auditors approve of all the audited subtrees in the expression as a whole does execution continue

At runtime, given an auditor and an instance of an ObjectExpr or PlumbingExpr audited by that auditor, it must be possible to unspoofably ask that auditor whether this is such an instance.

The Plumbing Definition Expression

"def" param :: auditors "match" pattern "{" body "}"

Define param to be an object that responds to all messages by matching against matcher.pattern and evaluating matcher.body.

See above for a description of auditors.

Method Definition

"to" verb "(" patterns*, ")" ":" returnType "{" body "}"

Defines a method for verb and a number of arguments matching the number of patterns.  When the containing object is sent such a message, the arguments are matched against the patterns, and then the body is evaluated. They value of body as coerced by returnType is finally revealed.

Matcher Definition

"match" pattern "{" body "}"

When the incoming message doesn't fit any of the methods, then a pair of the verb and the arguments is matched against patt, then body is evaluated, and it value revealed.

 

 
Unless stated otherwise, all text on this page which is either unattributed or by Mark S. Miller is hereby placed in the public domain.
ERights Home enative 
Back to: ENative: Compiling Variables x On to: ENative: Compiling Expressions
Download    FAQ    API    Mail Archive    Donate

report bug (including invalid html)

Golden Key Campaign Blue Ribbon Campaign