|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Method
ATMethods are the AmbientTalk's representation of methods as named functions. These
functions do not close over an environment allowing for them to be shared between
different clones. The environment is to be supplied during lookup (which wraps a
method into a Closure
). As a consequence, it is not possible to
get hold of a method at the base-level (since lookup implies wrapping).
Method Summary | |
---|---|
Table |
annotations()
Returns the annotations associated with the method. |
Object |
apply(Table arguments,
Context ctx)
Applies the method to the given arguments in the given context. |
Object |
applyInScope(Table arguments,
Context ctx)
Applies the method to the given arguments in the given context. |
Begin |
bodyExpression()
Returns the body of the method. |
Symbol |
name()
Returns the name of the method. |
Table |
parameters()
Returns the parameter list of the method which is normally a table of symbols. |
Closure |
wrap(Object lexicalScope,
Object dynamicReceiver)
Wrap the receiver method into a closure which packs together the code (method) and the scope (context) in which the code should be evaluated. |
Methods inherited from interface edu.vub.at.objects.Object |
---|
super |
Method Detail |
---|
Closure wrap(Object lexicalScope, Object dynamicReceiver)
lexicalScope
- the lexical scope in which the method was created. During method invocation,
lexical lookup should proceed along this scope.dynamicReceiver
- the dynamic receiver (value of self) at the time the method is
selected from an object.
Object apply(Table arguments, Context ctx)
The method itself is responsible for creating the appropriate 'call frame' or activation record in which to define temporary variables and parameter bindings.
arguments
- the actual arguments, already eagerly evaluated.ctx
- the context in which to evaluate the method body, call frame not yet inserted.
Object applyInScope(Table arguments, Context ctx)
The method will use the given context 'as-is', and will *not* insert an additional call frame.
arguments
- the actual arguments, already eagerly evaluated.ctx
- the context in which to evaluate the method body, to be used without inserting a call frame.
Symbol name()
Note that all methods (defined using def name( ...args... ) { ... }
or def foo: arg bar: arg { ... }
)
retain the name with which they were first bound. Literal blocks which may be created
outside of a definition are implicitly named 'lambda'.
Symbol
representing the name by which the method can be identified.Table parameters()
Table
representing the parameter list of the method.Begin bodyExpression()
Begin
representing the body of the method.Table annotations()
Table
containing the annotations of the method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |