edu.vub.at.objects.grammar
Interface ATDefExternalMethod

All Superinterfaces:
ATAbstractGrammar, ATConversions, ATDefinition, ATObject, ATStatement
All Known Implementing Classes:
AGDefExternalMethod

public interface ATDefExternalMethod
extends ATDefinition

Author:
tvc The public interface to an external method definition abstract grammar element. Created when evaluating def o.m() { body } There are three ways to evaluate such expressions with respect to what context should be active when the method is invoked upon the object: 1) The newly defined method is wrapped in a closure thereby fixing the lexical scope that was active at method definition/addition time, as well as the values of 'self' and 'super'. This has the advantage that within the externally added method body: a) the adding object can still access its lexical scope. b) the adding object can *not* access the scope of the object it is adding a method to. This has the disadvantage that within the externally added method body, 'self' and 'super' keep on referring to the lexically active self and super. This has the disadvantage that the newly added method cannot perform 'super sends', nor is the value of 'self' correct when the method is invoked through a child of o. 2) The newly defined method is added as-is to the object. This has roughly the reverse effects of option 1: the adding object loses its lexical scope (error-prone and dangerous!) but the values for self and super are correct. It is as if the method was really defined in the scope of the original object. 3) The newly defined method is wrapped in a special 'objectless' closure that captures the lexical scope of the adding object but *not* the values of 'self' and 'super'. When the added method is subsequently invoked, its lexical scope will still be that of the adding object (hence, having the benefits of option 1) while the values of 'self' and 'super' will be correct with respect to the method invocation on o (or a child of o) (hence, having the benefits of option 2). AmbientTalk implements the third option, by means of a NATClosureMethod.

Method Summary
 ATTable base_getArguments()
           
 ATBegin base_getBodyExpression()
           
 ATSymbol base_getReceiver()
           
 ATSymbol base_getSelector()
           
 
Methods inherited from interface edu.vub.at.objects.ATObject
base__opeql__opeql_, base_init, base_new, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_getStripes, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_newInstance, meta_pass, meta_print, meta_quote, meta_receive, meta_resolve, meta_respondsTo, meta_select, meta_send, meta_share
 
Methods inherited from interface edu.vub.at.objects.coercion.ATConversions
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText
 

Method Detail

base_getReceiver

public ATSymbol base_getReceiver()

base_getSelector

public ATSymbol base_getSelector()

base_getArguments

public ATTable base_getArguments()

base_getBodyExpression

public ATBegin base_getBodyExpression()