|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ATObject represents the public interface of an AmbientTalk/2 object. Any value representing an ambienttalk object should implement this interface. Some meta methods defined in this interface will give rise to events in the receiver object's beholders (i.e. the observers of the object's mirror). The principal implementors of this interface are: - NATNil which provides a default implementation for all native, non-object values The default implementation tries to make a Java native object look like an AmbientTalk object. - NATCallframe provides the implementation for a special kind of objects, namely call frames or 'activation records'. These are objects without true methods. - NATObject provides the most important implementation, namely that of base-level AmbientTalk objects. - NATSuperObject acts as a proxy to a NATObject. Therefore, it implements the ATObject interface by properly forwarding all methods to a wrapped object.
Method Summary | |
ATBoolean |
base__opeql__opeql_(ATObject other)
The pointer equality == operator. |
ATObject |
base_init(ATObject[] initargs)
The object initialisation method. |
ATObject |
base_new(ATObject[] initargs)
The object instantiation method. |
ATNil |
meta_addField(ATField field)
Adds a field slot to an object at runtime. |
ATNil |
meta_addMethod(ATMethod method)
Adds a method slot to an object at runtime. |
ATNil |
meta_assignField(ATObject receiver,
ATSymbol name,
ATObject value)
Sets the value of a field to the given value. |
ATNil |
meta_assignVariable(ATSymbol name,
ATObject value)
Sets the value of the variable to the given value. |
ATObject |
meta_clone()
Clone the receiver object. |
ATNil |
meta_defineField(ATSymbol name,
ATObject value)
Defines a new field in an object. |
ATObject |
meta_doesNotUnderstand(ATSymbol selector)
Called when a selection fails because the selector was not found along the dynamic delegation hierarchy. |
ATObject |
meta_eval(ATContext ctx)
Evaluates a particular parsetree with respect to a particular context. |
ATObject |
meta_extend(ATClosure code)
Create an is-a extension of the receiver object. |
ATObject |
meta_getDynamicParent()
Objects have a classical dynamic parent chain created using extension primitives. |
ATObject |
meta_getLexicalParent()
Objects also have a lexical parent which is the scope in which their definitions are nested. |
ATTable |
meta_getStripes()
Returns the stripes of this object. |
ATField |
meta_grabField(ATSymbol selector)
Queries an object for one of its field slots. |
ATMethod |
meta_grabMethod(ATSymbol selector)
Queries an object for one of its method slots. |
ATObject |
meta_invoke(ATObject receiver,
ATSymbol selector,
ATTable arguments)
Invoke a method corresponding to the selector with the given arguments. |
ATBoolean |
meta_isCloneOf(ATObject original)
Detects whether this object an the passed parameter are the result of cloning from a common ancestor (possibly either one of the objects itself). |
ATBoolean |
meta_isRelatedTo(ATObject object)
Detects whether both objects have a common origin, in other words whether they are related through a combination of the cloning and extension operators. |
ATBoolean |
meta_isStripedWith(ATStripe stripe)
Tests whether the receiver object is striped with a particular stripe. |
ATTable |
meta_listFields()
Queries an object for a list of all of its field slots. |
ATTable |
meta_listMethods()
Queries an object for a list of all of its method slots. |
ATObject |
meta_lookup(ATSymbol selector)
Select a slot (field | method) from an object whose name corresponds to the given selector. |
ATObject |
meta_newInstance(ATTable initargs)
Create a new instance of the receiver object. |
ATObject |
meta_pass()
Allows objects to specify how they should be passed when passed as an argument in a message sent to another actor. |
NATText |
meta_print()
Prints out the object in a human-readable way. |
ATObject |
meta_quote(ATContext ctx)
Quotes a parsetree, in other words allows the parsetree to return itself instead of evaluating. |
ATObject |
meta_receive(ATAsyncMessage message)
Handles a first-class message of which it is the receiver. |
ATObject |
meta_resolve()
When an object is deserialized after it has been passed to another actor, it is given a chance to tell the interpreter which object it represents. |
ATBoolean |
meta_respondsTo(ATSymbol selector)
Query an object for a given field or method which is visible to the outside world. |
ATObject |
meta_select(ATObject receiver,
ATSymbol selector)
Select a slot (field | method) from an object whose name corresponds to the given selector. |
ATObject |
meta_send(ATAsyncMessage message)
Sends a newly created message asynchronously by this object. |
ATObject |
meta_share(ATClosure code)
Create a shares-a extension of the receiver object. |
Method Detail |
public ATObject meta_send(ATAsyncMessage message) throws InterpreterException
message
- the asynchronous message (by default created using the actor's base_createMessage method)
Triggers the following events on this object's beholders (mirror observers):
- sentMessage when the message was sent by the actor.
InterpreterException
public ATObject meta_receive(ATAsyncMessage message) throws InterpreterException
message
- the asynchronous message send by some object possibly from another actor
InterpreterException
public ATObject meta_invoke(ATObject receiver, ATSymbol selector, ATTable arguments) throws InterpreterException
receiver
- the object to which 'self' is bound during execution of the methodselector
- the name of the method to be invokedarguments
- the table of arguments passed to the method
InterpreterException
public ATBoolean meta_respondsTo(ATSymbol selector) throws InterpreterException
selector
- the name of a field or method
InterpreterException
public ATObject meta_doesNotUnderstand(ATSymbol selector) throws InterpreterException
selector
- the selector that could not be found
XSelectorNotFound
- the default reaction to a failed selection
InterpreterException
public ATObject meta_pass() throws InterpreterException
InterpreterException
- - when overridden by the programmerpublic ATObject meta_resolve() throws InterpreterException
XIllegalOperation
- when by-reference objects are resolved or when overridden by programmer
InterpreterException
public ATObject meta_select(ATObject receiver, ATSymbol selector) throws InterpreterException
receiver
- the dynamic receiver to which method closures should bind self.selector
- the name of the field or method sought for.
InterpreterException
public ATObject meta_lookup(ATSymbol selector) throws InterpreterException
selector
- the name of the field or method to look up.
XUndefinedField
- if the field cannot be found
Triggers the slotSelected event on this object's beholders (mirror observers).
InterpreterException
public ATNil meta_defineField(ATSymbol name, ATObject value) throws InterpreterException
name
- the name of the new fieldvalue
- the value of the new field
XDuplicateSlot
- if the field name already exists
Triggers the fieldAdded event on this object's beholders (mirror observers) if
the field is added successfully.
InterpreterException
public ATNil meta_assignVariable(ATSymbol name, ATObject value) throws InterpreterException
name
- a symbol representing the name of the variable to assign.value
- the value to assign to the specified slot.
XUnassignableField
- if the field to set cannot be found.
InterpreterException
public ATNil meta_assignField(ATObject receiver, ATSymbol name, ATObject value) throws InterpreterException
receiver
- the object which received (and possibly delegated) the requestname
- a symbol representing the field to assign.value
- the value to assign to the specified slot.
XUnassignableField
- if the field to set cannot be found.
InterpreterException
public ATObject meta_clone() throws InterpreterException
InterpreterException
public ATObject meta_newInstance(ATTable initargs) throws InterpreterException
initargs
- arguments to the 'init' constructor method
InterpreterException
public ATObject meta_extend(ATClosure code) throws InterpreterException
InterpreterException
public ATObject meta_share(ATClosure code) throws InterpreterException
obj.share { code }
is represented at the meta-level by
mirror(obj).meta_share(code)
Triggers the objectShared event on this object's beholders (mirror observers).
InterpreterException
public ATNil meta_addField(ATField field) throws InterpreterException
field
- a mirror on the field to add, consisting of a selector (a symbol) and a value (an object)
XDuplicateSlot
- if the field name already exists
TODO: return value = nil?
InterpreterException
public ATNil meta_addMethod(ATMethod method) throws InterpreterException
method
- a mirror on the method to add. A method consists of a selector, arguments and a body.
XDuplicateSlot
- if the method's selector already exists
TODO: return value = nil? argument = a method mirror or a closure mirror?
InterpreterException
public ATField meta_grabField(ATSymbol selector) throws InterpreterException
selector
- a symbol representing the name of the slot.
XUndefinedField
- if the field cannot be found.
InterpreterException
public ATMethod meta_grabMethod(ATSymbol selector) throws InterpreterException
selector
- a symbol representing the name of the slot.
XSelectorNotFound
- if the method cannot be found.
InterpreterException
public ATTable meta_listFields() throws InterpreterException
InterpreterException
public ATTable meta_listMethods() throws InterpreterException
InterpreterException
public ATObject meta_getDynamicParent() throws InterpreterException
InterpreterException
public ATObject meta_getLexicalParent() throws InterpreterException
InterpreterException
public ATObject meta_eval(ATContext ctx) throws InterpreterException
ctx
- - context (object) to lookup bindings in.
InterpreterException
public ATObject meta_quote(ATContext ctx) throws InterpreterException
ctx
- - context passed on to be used in subsequent evaluations.
InterpreterException
- upon conversion errors or upon illegal unquoted expressionspublic NATText meta_print() throws InterpreterException
InterpreterException
public ATBoolean meta_isRelatedTo(ATObject object) throws InterpreterException
InterpreterException
public ATBoolean meta_isCloneOf(ATObject original) throws InterpreterException
original
- - the object of which this object is supposedly a sibling
InterpreterException
public ATBoolean meta_isStripedWith(ATStripe stripe) throws InterpreterException
InterpreterException
public ATTable meta_getStripes() throws InterpreterException
InterpreterException
public ATBoolean base__opeql__opeql_(ATObject other) throws InterpreterException
InterpreterException
public ATObject base_new(ATObject[] initargs) throws InterpreterException
InterpreterException
public ATObject base_init(ATObject[] initargs) throws InterpreterException
InterpreterException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |