Startup sequence:
I) parse command-line arguments, extract properties
II) check for simple -help or -version arguments
III) Boot sequence:
1) initialize the lobby using the object path (-o or default)
2) add system object to the global lexical scope
3) evaluate init file (-i or default) in context of the global scope
4) if -e was specified, then
evaluate the given code in a 'main' namespace
else if a filename was specified then
load the file and evaluate it within its 'main' namespace
else
skip
5) if -p was specified, then
print value of last evaluation
quit
else
IV) enter REPL:
1) print input prompt (unless -q)
2) read input
3) parse input
4) eval input in the 'main' namespace
5) print output prompt (unless -q)
6) print value of last evaluation
To evaluate a function application, evaluate the receiver expression to a function, then evaluate the arguments
to the function application eagerly and apply the function.
To evaluate a field assignment, evaluate the receiver expression, evaluate the right hand side and ask
the receiver object to assign the RHS value to the field corresponding to the given field name.
To evaluate a variable assignment, evaluate the right hand side and ask
the current object to assign that value to the field corresponding to the left hand side.
Defining a table requires evaluating its index expression to a size s,
then allocating a new table of size s and finally initializing it
by evaluating its initializer body s times.
To evaluate a first-class delegation message creation AG element, transform the selector
and evaluated arguments into a first-class NATDelegation object.
To evaluate a multiple assignment, evaluate the right hand side to a table
and assign the parameters on the left hand side to the 'arguments' of the right hand side,
almost as if they were bound during a function call (the parameters are assigned instead of defined).
To evaluate a multiple definition, evaluate the right hand side to a table
and bind the parameters on the left hand side to the 'arguments' of the right hand side,
exactly as if they were bound during a function call.
To evaluate a tabulation, evaluate the tabulation expression to a table,
evaluate the index expression into a valid index, and then access the table at the given index slot.
The effect of invoking methods on a mirror (through meta_invoke) consists of
checking whether the requested functionality is provided as a meta-operation
by the principal that is wrapped by this mirror.
The effect of invoking methods on a mirror (through meta_invoke) consists of
checking whether the requested functionality is provided as a meta-operation
by the principal that is wrapped by this mirror.
The default behaviour of 'delegate' for primitive non-object ambienttalk language values is
to check whether the requested functionality is provided by a native Java method
with the same selector, but prefixed with 'base_'.
When a method is invoked upon a symbiotic Java class object, the underlying static Java method
with the same name as the AmbientTalk selector is invoked.
Detects whether both objects have a common origin, in other words whether
they are related through a combination of the cloning and extension operators.
Listing the methods of a mirror requires us to list all of the meta_ methods
of the principal (excluding meta_get/set methods) + all of the base_ methods
(excluding base_get/set methods) of the mirror itself
Querying a symbiotic Java class object for its methods results in a table containing
both 'native' static Java methods and the methods of its AT symbiont
Querying a symbiotic Java object for its methods results in a table containing
both all 'native' Java instance methods and the methods of its AT symbiont
Cannot create a new instance using a farObject, this should be done either by
sending rather than invoking new(args) such that the correct method is triggered
or by invoking newInstance on a farMirror, which will send the call as well.
aJavaClass.new(@args) == invoke a Java constructor
AmbientTalk objects can add a custom new method to the class in order to intercept
instance creation.
This method allows objects to decide which object should be serialized in their
stead when they are passed as argument in an asynchronous message send that
crosses actor boundaries.
Passing a Java Object wrapper to another actor has the following effect:
- if the wrapped Java object is serializable, the symbiotic AmbientTalk object
is treated as by copy (i.e. as an isolate)
A mirror responds to a message m if and only if:
- either its principal has a method named meta_m
- or the mirror itself implements a method named base_m
An ambienttalk object can respond to a message if a corresponding field or method exists
either in the receiver object locally, or in one of its dynamic parents.
A symbiotic Java class object responds to all of the public static selectors of its Java class
plus all of the per-instance selectors added to its AmbientTalk symbiont.
A symbiotic Java object responds to all of the public non-static selectors of its Java class
plus all of the per-instance selectors added to its AmbientTalk symbiont.
The effect of selecting fields or methods on a mirror (through meta_select)
consists of checking whether the requested selector matches a field of the
principal wrapped by this mirror.
The effect of selecting fields or methods on a mirror (through meta_select)
consists of checking whether the requested selector matches a field of the
principal wrapped by this mirror.
When selecting a field from a symbiotic Java class object, if the object's class
has a static field with a matching selector, it is automatically read;
if it has methods corresponding to the selector, they are returned in a JavaMethod wrapper,
otherwise, the fields of its AT symbiont are checked.
When selecting a field from a symbiotic Java object, if the
Java symbiont object's class has a non-static field with a matching selector,
it is automatically read; if it has a corresponding method, the method is returned
in a closure.
To send a message msg to a receiver object rcv:
- if rcv is a local reference, schedule accept(msg) in my incoming event queue
- if rcv is a far reference, schedule msg in far reference's outbox