Differences

This shows you the differences between the selected revision and the current version of the page.

at:tutorial:reflection 2010/11/16 15:59 at:tutorial:reflection 2010/11/16 16:32 current
Line 4: Line 4:
The reflective model of AmbientTalk is based on [[http://bracha.org/mirrors.pdf|mirrors]], meta-level objects which allow one to reflect on an object's state and behaviour. How to create such mirrors and how they can be used is demonstrated in the first part of the tutorial. The second part of the tutorial showcases how to construct mirages, objects which override the default meta-level operations with custom behaviour. This tutorial concludes with a brief overview of the meta-level operations which are offered by AmbientTalk mirrors. The reflective model of AmbientTalk is based on [[http://bracha.org/mirrors.pdf|mirrors]], meta-level objects which allow one to reflect on an object's state and behaviour. How to create such mirrors and how they can be used is demonstrated in the first part of the tutorial. The second part of the tutorial showcases how to construct mirages, objects which override the default meta-level operations with custom behaviour. This tutorial concludes with a brief overview of the meta-level operations which are offered by AmbientTalk mirrors.
 +
===== Mirrors ===== ===== Mirrors =====
Line 45: Line 46:
> def x :=mirrorOnP.grabSlot(`x) > def x :=mirrorOnP.grabSlot(`x)
>> <accessor method for:x> >> <accessor method for:x>
-> x() 
->> 2 
// and we can also invoke methods reflectively: // and we can also invoke methods reflectively:
> mirrorOnP.invoke(p, lobby.at.lang.values.createInvocation(`distanceToOrigin,[],[])); > mirrorOnP.invoke(p, lobby.at.lang.values.createInvocation(`distanceToOrigin,[],[]));
 
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki