|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
at.objects.natives.OBJLexicalRoot
class LexicalRoot
The singleton instance of this class represents the lexical root of an actor. Since this lexical root is constant (it cannot be modified) and contains no mutable fields, it is possible to share a singleton instance of this class among all actors.
The lexical root is an object containing globally visible AmbientTalk native methods. Such methods include control structures such as if:then:else: but also object creation methods like object: and reflective constructs like reflect:. Furthermore, the lexical root is also the root of the lexical parent hierarchy for objects. This means that this object's mirror is responsible for ending recursive meta-level methods such as lookup and assignField.
Like any class whose instances represent native AmbientTalk objects, this class is a subclass
of NativeATObject
. This means that this class can use the typical protocol of native objects
to implement base-level AmbientTalk methods as Java methods whose name is prefixed with
base_.
Note that OBJLexicalRoot is a sentinel class. The actual object bound to the lexical root of an actor (accessible via the field root will be a normal AmbientTalk object whose lexical parent is this object. The real, empty, root object is local to each actor and is mutable. The definitions from the init.at file are added to that object.
Method Summary | |
---|---|
Object |
/()
/ evaluates to the global namespace. |
Boolean |
==(Object comparand)
Compare the receiver object to the root object. |
Numeric |
-(Numeric n)
The unary - primitive. |
Boolean |
!(Boolean b)
The unary ! |
Number |
+(Number n)
The unary + primitive. |
Object |
actor:(Closure closure)
The actor: closure construct. |
Text |
asCode:(Object obj)
The asCode: metaprogramming construct. |
Object |
clone:(Object original)
The clone: language construct. |
Object |
defaultMirror()
defaultMirror evaluates to the default mirror on objects. |
Object |
disconnect:(Object object)
The disconnect: construct. |
Object |
do:if:(Closure body,
Boolean condition)
The do:if: control structure. |
Object |
do:unless:(Closure body,
Boolean condition)
The do:unless: control structure. |
Object |
eval:in:(AbstractGrammar ast,
Object obj)
The eval:in: metaprogramming construct. |
Object |
export:as:(Object object,
TypeTag topic)
The export: object as: topic construct. |
Object |
extend:with:(Object parent,
Closure code)
The extend:with: object creation primitive. |
Object |
extend:with:mirroredBy:(Object parent,
Closure code,
Object mirror)
The extend:with:mirroredBy: object creation primitive. |
Object |
extend:with:taggedAs:(Object parent,
Closure code,
Table types)
The extend:with:taggedAs: object creation primitive. |
Object |
extend:with:taggedAs:mirroredBy:(Object parent,
Closure code,
Table types,
Object mirror)
The extend:with:taggedAs:mirroredBy: object creation primitive. |
Boolean |
false()
false evaluates to the unique boolean false object. |
Object |
foreach:in:(Closure body,
Table tab)
The foreach:in: control structure. |
Object |
handle:with:(TypeTag filter,
Closure replacementCode)
The handle: type with: { |e| replacementCode } construct. |
Object |
if:then:(Boolean cond,
Closure consequent)
The if:then: control structure. |
Object |
if:then:else:(Boolean cond,
Closure consequent,
Closure alternative)
The if:then:else: control structure. |
Boolean |
is:taggedAs:(Object object,
TypeTag type)
The is: object taggedAs: type construct. |
Object |
isolate:(Closure code)
The isolate: object creation primitive. |
Object |
jlobby()
jlobby evaluates to the Java namespace root. |
Object |
let:(Closure body)
The let: construct. |
Object |
lobby()
lobby evaluates to the global namespace object. |
Object |
mirror:(Closure code)
The mirror: object creation primitive. |
Object |
network()
network evaluates to the unique network control object. |
Nil |
nil()
nil evaluates to the nil object, which is the empty, dynamic parent of all AmbientTalk objects. |
Object |
object:(Closure code)
The object: object creation primitive. |
Object |
object:childOf:extends:taggedAs:mirroredBy:(Closure code,
Object parent,
Boolean parentType,
Table types,
Object mirror)
The object:childOf:extends:taggedAs:mirroredBy: object creation primitive. |
Object |
object:mirroredBy:(Closure code,
Object mirror)
The object:mirroredBy: object creation primitive. |
Object |
object:taggedAs:(Closure code,
Table types)
The object:taggedAs: object creation primitive. |
Object |
object:taggedAs:mirroredBy:(Closure code,
Table types,
Object mirror)
The object:taggedAs:mirroredBy: object creation primitive. |
Text |
print:(Object obj)
The print: metaprogramming construct. |
Nil |
raise:(Object anExceptionObject)
The raise: exception construct. |
AbstractGrammar |
read:(Text source)
The read: metaprogramming construct. |
Object |
reflect:(Object reflectee)
The reflect: construct. |
ActorMirror |
reflectOnActor()
reflectOnActor evaluates to the mirror on the actor executing this code. |
Table |
retract:(FarReference farReference)
The retract: farReference construct. |
Object |
root()
root evaluates to the global lexical scope object. |
Object |
share:with:(Object parent,
Closure code)
The share:with: object creation primitive. |
Object |
share:with:mirroredBy:(Object parent,
Closure code,
Object mirror)
The share:with:mirroredBy: object creation primitive. |
Object |
share:with:taggedAs:(Object parent,
Closure code,
Table types)
The share:with:taggedAs: object creation primitive. |
Object |
share:with:taggedAs:mirroredBy:(Object parent,
Closure code,
Table types,
Object mirror)
The share:with:taggedAs:mirroredBy: object creation primitive. |
Table |
tagsOf:(Object object)
The tagsOf: object construct. |
Nil |
takeOffline:(Object object)
The takeOffline: construct. |
Boolean |
true()
true evaluates to the unique boolean true object. |
Object |
try:catch:using:(Closure tryBlock,
TypeTag filter,
Closure replacementCode)
The try: { tryBlock} catch: type using: { |e| replacementCode } 'Syntactic sugar' for one "in-line", native handler. |
Object |
try:catch:using:catch:using:(Closure tryBlock,
TypeTag filter1,
Closure hdl1,
TypeTag filter2,
Closure hdl2)
The try:catch:using:catch:using: construct. |
Object |
try:catch:using:catch:using:catch:using:(Closure tryBlock,
TypeTag filter1,
Closure hdl1,
TypeTag filter2,
Closure hdl2,
TypeTag filter3,
Closure hdl3)
The try:catch:using:catch:using:catch:using: construct. |
Object |
try:catch:using:catch:using:catch:using:finally:(Closure tryBlock,
TypeTag filter1,
Closure hdl1,
TypeTag filter2,
Closure hdl2,
TypeTag filter3,
Closure hdl3,
Closure finallyBlock)
The try:catch:using:catch:using:catch:using:finally: construct. |
Object |
try:catch:using:catch:using:finally:(Closure tryBlock,
TypeTag filter1,
Closure hdl1,
TypeTag filter2,
Closure hdl2,
Closure finallyBlock)
The try:catch:using:catch:using:finally: construct. |
Object |
try:catch:using:finally:(Closure tryBlock,
TypeTag filter,
Closure replacementCode,
Closure finallyBlock)
The try: { tryBlock} catch: type using: { |e| replacementCode } finally: { finallyBlock } 'Syntactic sugar' for one "in-line", native handler. |
Object |
try:finally:(Closure tryBlock,
Closure finallyBlock)
The try: { tryBlock } finally: { finallyBlock } construct. |
Object |
try:using:(Closure tryBlock,
Handler handler)
The try: { tryBlock} using: handler construct. |
Object |
try:using:finally:(Closure tryBlock,
Handler handler,
Closure finallyBlock)
The try: { tryBlock} using: handler finally: { finallyBlock } construct. |
Object |
try:using:using:(Closure tryBlock,
Handler hdl1,
Handler hdl2)
The try: { tryBlock} using: handler1 using: handler2 construct. |
Object |
try:using:using:finally:(Closure tryBlock,
Handler hdl1,
Handler hdl2,
Closure finallyBlock)
The try: { tryBlock} using: handler1 using: handler2 finally: { finallyBlock } construct. |
Object |
try:using:using:using:(Closure tryBlock,
Handler hdl1,
Handler hdl2,
Handler hdl3)
The try: { tryBlock} using: hdl1 using: hdl2 using: hdl3 construct. |
Object |
try:using:using:using:finally:(Closure tryBlock,
Handler hdl1,
Handler hdl2,
Handler hdl3,
Closure finallyBlock)
The try: { tryBlock} using: hdl1 using: hdl2 using: hdl3 finally: { finallyBlock } construct. |
Object |
try:usingHandlers:(Closure tryBlock,
Table exceptionHandlers)
The try: { tryBlock } usingHandlers: [ handler1, handler2, ... ] construct. |
Object |
try:usingHandlers:finally:(Closure tryBlock,
Table exceptionHandlers,
Closure finallyBlock)
The try: { tryBlock } usingHandlers: [ handler1, handler2, ... ] finally: { finallyBlock } construct. |
Object |
when:discovered:(TypeTag topic,
Closure handler)
The when: topic discovered: handler construct. |
Object |
when:takenOffline:(FarReference farReference,
Closure listener)
The when: farReference takenOffline: construct. |
Object |
whenever:disconnected:(FarReference farReference,
Closure listener)
The whenever: farReference disconnected: listener construct. |
Object |
whenever:discovered:(TypeTag topic,
Closure handler)
The whenever: topic discovered: handler construct. |
Object |
whenever:reconnected:(FarReference farReference,
Closure listener)
The whenever: farReference reconnected: listener construct. |
Object |
while:do:(Closure condition,
Closure body)
The while:do: control structure. |
Methods inherited from class edu.vub.at.objects.natives.NativeATObject |
---|
==, freeVariables, super |
Methods inherited from interface edu.vub.at.objects.AbstractGrammar |
---|
freeVariables |
Methods inherited from interface edu.vub.at.objects.Object |
---|
super |
Method Detail |
---|
public Nil nil()
public Boolean true()
public Boolean false()
public Object /()
base_lobby()
public Object lobby()
Accessing the lobby allows loading in AmbientTalk source code from external files.
public Object root()
public Object jlobby()
jlobby.java.util.Vector
evaluates to a reference to
the Java Vector class.
public Object network()
public Object defaultMirror()
reflect: (object: { ... })
.
The default mirror is an object with a read-only base field
that signifies the base-level object of this mirror. The main purpose
of this object is to serve as a prototype whose methods can be overridden
by custom mirrors. The syntax:
mirror: { ... }is syntactic sugar for:
extend: defaultMirror with: { ... }Note that the default mirror is typed with the /.at.types.Mirror type.
public Object if:then:(Boolean cond, Closure consequent)
if: cond then: consequentpseudo-implementation:
cond.ifTrue: consequentNote that the consequent parameter should be a closure, i.e. the caller is responsible for delaying the evaluation of the consequent!
cond
- a boolean objectconsequent
- a closure containing the code to execute if the boolean is true
public Object if:then:else:(Boolean cond, Closure consequent, Closure alternative)
if: cond then: consequent else: alternativepseudo-implementation:
cond.ifTrue: consequent ifFalse: alternativeNote that the consequent and alternative parameters should be closures, i.e. the caller is responsible for delaying the evaluation of these arguments!
cond
- a boolean objectconsequent
- a closure containing the code to execute if the boolean is truealternative
- a closure containing the code to execute if the boolean is false
public Object while:do:(Closure condition, Closure body)
while: condition do: bodypseudo-implementation:
condition.whileTrue: bodyNote that both the condition and the body should be closures, because they represent pieces of code that have to be executed repeatedly. Because of traditional syntax, novice programmers are inclined to make the mistake of writing, e.g.:
while: (i < 10) do: { i := i + 1 }Which is wrong because the first parameter should evaluate to a closure that itself returns a boolean value, not to a boolean value directly.
condition
- a closure expected to return a boolean objectbody
- a closure containing the code to execute as long as the condition closure returns true
public Object foreach:in:(Closure body, Table tab)
foreach: body in: tablepseudo-implementation:
table.each: bodyExample:
[1,2,3].each: { |i| system.println(i) }
body
- a one-arity closure that is to be applied to each element of the tabletab
- a table to apply the body closure to
public Object do:if:(Closure body, Boolean condition)
do: body if: conditionpseudo-implementation:
condition.ifTrue: bodyIn Ruby, this kind of control structure is called a statement modifier.
body
- a zero-argument closure to execute if the condition is truecondition
- a boolean value
public Object do:unless:(Closure body, Boolean condition)
do: body unless: conditionpseudo-implementation:
condition.ifFalse: bodyIn Ruby, this kind of control structure is called a statement modifier. Example:
do: { file.close() } unless: (nil == file)
body
- a zero-argument closure to execute only if the condition is falsecondition
- a boolean value
public Object let:(Closure body)
let: { |var := value| body }pseudo-implementation:
closure()let: allows for the easy creation of temporary local variables. This construct should be used in conjunction with a closure that declares optional parameters. Because the closure will be invoked with zero arguments, all of the parameters will be given their corresponding default initial value. The parameters are defined local to the closure's body. AmbientTalk's let: behaves like Scheme's let* and letrec, i.e. the following is legal:
let: { |var1 := value1, var2 := var1, var3 := { ... var3() ... }| ... }
body
- a closure which is supposed to declare some optional parameters
public Object actor:(Closure closure)
closure
- the closure whose parameters define lexical fields to be copied and whose
method specifies the code of the new actor's behaviour object
public ActorMirror reflectOnActor()
public Object export:as:(Object object, TypeTag topic)
actor.provide(topic, object)This construct enables the given object to become discoverable by objects in other actors by means of the topic type.
object
- the object to export to remote actors' objectstopic
- a type denoting the abstract 'publication topic' for this object's publication
public Object when:discovered:(TypeTag topic, Closure handler)
actor.require(topic, handler, false)When an object is exported by another actor under topic, this construct triggers the given code, passing a reference to the exported object as argument to the closure. Once the code block has run once, it will not be triggered again.
topic
- the abstract 'subscription topic' used to find an exported objecthandler
- a one-argument closure to apply to a discovered exported object
public Object whenever:discovered:(TypeTag topic, Closure handler)
actor.require(topic, handler, true)When an object is exported by another actor under topic, this construct triggers the given code, passing a reference to the exported object as argument to the closure. The code block can be fired multiple times upon discovering multiple exported objects. To stop the block from triggering upon new publications, it must be explicitly cancelled
topic
- the abstract 'subscription topic' used to find an exported objecthandler
- a one-argument closure to apply to any discovered exported object
public Object whenever:disconnected:(FarReference farReference, Closure listener)
farReference
- a native far referencelistener
- a zero-arity closure to invoke if the far reference becomes disconnected
public Object whenever:reconnected:(FarReference farReference, Closure listener)
farReference
- a native far referencelistener
- a zero-arity closure to invoke if the far reference becomes reconnected
public Object when:takenOffline:(FarReference farReference, Closure listener)
farReference
- a native far referencelistener
- a zero-arity closure to invoke if the referenced object has been taken offline.
public Table retract:(FarReference farReference)
farReference
- the far reference of which to retract outgoing message sends
public Object object:(Closure code)
object: { def x := 1; }
Pseudo-implementation:
object: code childOf: nil extends: false taggedAs: [] mirroredBy: defaultMirrorThe closure used to initialize the object may contain formal parameters. The closure will always be invoked with its own mandatory formal parameters. E.g., a closure
{ |x| nil }
is invoked as { |x| nil }(x)
. The net effect of this
mechanic is that if x is a lexically visible variable at the object-creation
site, the value of the variable will be copied into a copy with the same name which
resides in the newly created object. This mechanic is primarily useful for copying surrounding
variables within the object, e.g. for isolates which lose access to their surrounding scope.
Also, if the closure has optional parameters, they will always be triggered. The expressions to initialize the formal parameters are evaluated in the context of the closure's lexical scope but are added to the newly created object.
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object extend:with:(Object parent, Closure code)
extend: parent with: { def x := 1; }
Pseudo-implementation:
object: code childOf: parent extends: true taggedAs: [] mirroredBy: defaultMirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object extend:with:taggedAs:(Object parent, Closure code, Table types)
extend: parent with: { def x := 1; } taggedAs: [foo,bar]
Pseudo-implementation:
object: code childOf: parent extends: true taggedAs: types mirroredBy: defaultMirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of types with which to type the newly created object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object extend:with:mirroredBy:(Object parent, Closure code, Object mirror)
extend: parent with: { def x := 1; } mirroredBy: (mirror: {...})
Pseudo-implementation:
object: code childOf: parent extends: true taggedAs: [] mirroredBy: mirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.mirror
- the mirror of the newly created mirage object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object extend:with:taggedAs:mirroredBy:(Object parent, Closure code, Table types, Object mirror)
extend: parent with: { def x := 1; } taggedAs: [foo,bar] mirroredBy: mirror
Pseudo-implementation:
object: code childOf: parent extends: true taggedAs: types mirroredBy: mirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of types with which to type the newly created object.the
- mirror object of the newly created mirage object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object share:with:(Object parent, Closure code)
share: parent with: { def x := 1; }
Pseudo-implementation:
object: code childOf: parent extends: false taggedAs: [] mirroredBy: defaultMirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object share:with:taggedAs:(Object parent, Closure code, Table types)
share: parent with: { def x := 1; } taggedAs: [foo,bar]
Pseudo-implementation:
object: code childOf: parent extends: false taggedAs: types mirroredBy: defaultMirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of types with which to type the newly created object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object share:with:mirroredBy:(Object parent, Closure code, Object mirror)
share: parent with: { def x := 1; } mirroredBy: (mirror: {...})
Pseudo-implementation:
object: code childOf: parent extends: false taggedAs: [] mirroredBy: mirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.mirror
- the mirror of the newly created mirage object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object share:with:taggedAs:mirroredBy:(Object parent, Closure code, Table types, Object mirror)
share: parent with: { def x := 1; } taggedAs: [foo,bar] mirroredBy: mirror
Pseudo-implementation:
object: code childOf: parent extends: false taggedAs: types mirroredBy: mirror
parent
- the dynamic parent object of the newly created object.code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of types with which to type the newly created object.mirror
- the mirror object of the newly created mirage object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object object:taggedAs:(Closure code, Table types)
object: { def x := 1; } taggedAs: [foo,bar]
Pseudo-implementation:
object: code childOf: nil extends: false taggedAs: types mirroredBy: defaultMirror
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of type tags with which to type the newly created object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object isolate:(Closure code)
isolate: { def x := 1; }
Pseudo-implementation:
object: code childOf: nil extends: false taggedAs: [/.at.types.Isolate] mirroredBy: defaultMirrorAn isolate is an object without a proper lexical parent. It is as if the isolate is always defined at top-level. However, lexically visible variables can be retained by copying them into the isolate by means of formal parameters to the argument closure. Isolate objects are passed by-copy during inter-actor parameter and result passing.
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object mirror:(Closure code)
mirror: { def x := 1; }
Pseudo-implementation:
object: code childOf: defaultMirror extends: true taggedAs: [] mirroredBy: defaultMirrorThis construct is mere syntactic sugar for creating an extension of the default mirror root. It follows that AmbientTalk mirrors are plain AmbientTalk objects. They simply need to implement the entire metaobject protocol, and the easiest means to achieve this is by extending the default mirror. Also keep in mind that the mirror is an extension object. This is important because the default mirror has state, being the base field that points to the base-level object being mirrorred. Hence, always make sure that, if overriding init, the parent's init method is invoked with the appropriate base value.
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object object:mirroredBy:(Closure code, Object mirror)
object: { def x := 1; } mirroredBy: (mirror: {...})
Pseudo-implementation:
object: code childOf: nil extends: false taggedAs: [] mirroredBy: mirrorThis primitive allows the construction of so-called mirage objects which are AmbientTalk objects whose metaobject protocol behaviour is dictated by a custom mirror object.
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.mirror
- the mirror prototype of the newly created mirage object, or a constructor closure.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object object:taggedAs:mirroredBy:(Closure code, Table types, Object mirror)
object: { def x := 1; } taggedAs: [foo,bar] mirroredBy: (mirror: {...})
Pseudo-implementation:
object: code childOf: nil extends: false taggedAs: types mirroredBy: mirror
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.types
- a table of types with which to type the newly created object.mirror
- the mirror of the newly created mirage object.
base_object_(ATClosure)
,
base_object_childOf_extends_taggedAs_mirroredBy_(ATClosure, ATObject, ATBoolean, ATTable, ATObject)
public Object object:childOf:extends:taggedAs:mirroredBy:(Closure code, Object parent, Boolean parentType, Table types, Object mirror)
object: { def x := 1; } childOf: parent extends: true taggedAs: [foo,bar] mirroredBy: mirror
Pseudo-implementation:
let o = OBJECT(parent,code.lexicalParent,parentType,types); code.applyInScope(o, code.mandatoryPars); o
code
- a closure containing both the code with which to initialize the object and the new object's lexical parent.parent
- the dynamic parent object of the newly created object.parentType
- a boolean denoting whether or not the object is an extension of its dynamic parent.types
- a table of types with which the newly created object should be typed.mirror
- the mirror of the newly created object.
for more information about the properties of the passed closure.
public Object reflect:(Object reflectee)
actor.createMirror(reflectee)An actor can change its default mirror creation policy by installing a new actor protocol that overrides createMirror.
reflectee
- the object to reflect upon
for the details about mirror creation on objects.
public Object clone:(Object original)
def clone: obj { if: (is: obj taggedAs: Mirror) then: { reflect: (clone: obj.base) } else: { (reflect: obj).clone() } }The default cloning semantics ensures that all fields of the object are shallow-copied. Because methods are immutable, a clone and its original object share their method dictionary, but whenever a change is made to the dictionary, the changer creates a local copy of the dictionary as to not modify any clones. Hence, each object is truly stand-alone and independent of its clone.
original
- the object to copy
public Nil takeOffline:(Object object)
public Object disconnect:(Object object)
public Boolean is:taggedAs:(Object object, TypeTag type)
public Table tagsOf:(Object object)
public Object try:finally:(Closure tryBlock, Closure finallyBlock)
public Object try:usingHandlers:finally:(Closure tryBlock, Table exceptionHandlers, Closure finallyBlock)
for the interface to which a handler object has to adhere
public Object try:usingHandlers:(Closure tryBlock, Table exceptionHandlers)
base_try_usingHandlers_finally_(ATClosure, ATTable, ATClosure)
public Object try:using:(Closure tryBlock, Handler handler)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:using:finally:(Closure tryBlock, Handler handler, Closure finallyBlock)
base_try_usingHandlers_finally_(ATClosure, ATTable, ATClosure)
public Object try:using:using:(Closure tryBlock, Handler hdl1, Handler hdl2)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:using:using:finally:(Closure tryBlock, Handler hdl1, Handler hdl2, Closure finallyBlock)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:using:using:using:(Closure tryBlock, Handler hdl1, Handler hdl2, Handler hdl3)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:using:using:using:finally:(Closure tryBlock, Handler hdl1, Handler hdl2, Handler hdl3, Closure finallyBlock)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:(Closure tryBlock, TypeTag filter, Closure replacementCode)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:finally:(Closure tryBlock, TypeTag filter, Closure replacementCode, Closure finallyBlock)
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:catch:using:(Closure tryBlock, TypeTag filter1, Closure hdl1, TypeTag filter2, Closure hdl2)
try: { tryBlock } catch: type using: { |e| replacementCode } catch: type2 using: { |e| replacementCode2 }'Syntactic sugar' for two in-line handlers
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:catch:using:finally:(Closure tryBlock, TypeTag filter1, Closure hdl1, TypeTag filter2, Closure hdl2, Closure finallyBlock)
try: { tryBlock } catch: type using: { |e| replacementCode } catch: type2 using: { |e| replacementCode2 } finally: { finalizationCode }'Syntactic sugar' for two in-line handlers
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:catch:using:catch:using:(Closure tryBlock, TypeTag filter1, Closure hdl1, TypeTag filter2, Closure hdl2, TypeTag filter3, Closure hdl3)
try: { tryBlock } catch: type using: { |e| replacementCode } catch: type2 using: { |e| replacementCode2 } catch: type3 using: { |e| replacementCode3 }'Syntactic sugar' for three in-line handlers
base_try_usingHandlers_(ATClosure, ATTable)
public Object try:catch:using:catch:using:catch:using:finally:(Closure tryBlock, TypeTag filter1, Closure hdl1, TypeTag filter2, Closure hdl2, TypeTag filter3, Closure hdl3, Closure finallyBlock)
try: { tryBlock } catch: type using: { |e| replacementCode } catch: type2 using: { |e| replacementCode2 } catch: type3 using: { |e| replacementCode3 }'Syntactic sugar' for three in-line handlers
base_try_usingHandlers_(ATClosure, ATTable)
public Object handle:with:(TypeTag filter, Closure replacementCode)
for the interface to which a handler object responds.
public Nil raise:(Object anExceptionObject)
base_try_usingHandlers_(ATClosure, ATTable)
public Boolean !(Boolean b)
!b == b.not()
b
- the boolean to negate.
public Numeric -(Numeric n)
-NUM(n) == 0 - n
n
- a number or a fraction to negate.public Number +(Number n)
+NBR(n) == NBR(n)
public AbstractGrammar read:(Text source)
read: "x" => `x
public Object eval:in:(AbstractGrammar ast, Object obj)
eval: `x in: object: { def x := 1 } => 1
This is a "dangerous" operation in the sense that lexical encapsulation of the given
object can be violated.
public Text print:(Object obj)
public Text asCode:(Object obj)
public Boolean ==(Object comparand)
==(obj)
is equivalent to root == obj
(or "root.==(obj)")
==
in class at.objects.natives.NativeATObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |