User Tools

Site Tools


at:tutorial:objects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:objects [2007/07/04 16:23] jorgeat:tutorial:objects [2007/07/05 14:03] jorge
Line 22: Line 22:
 As all definitions in AmbientTalk, objects, fields and methods are defined using the **def** keyword. Fields are defined using a ''def name := value'' syntax while methods are defined using a ''name(parameters) {body}'' syntax. As all definitions in AmbientTalk, objects, fields and methods are defined using the **def** keyword. Fields are defined using a ''def name := value'' syntax while methods are defined using a ''name(parameters) {body}'' syntax.
  
-<note important>+<note>
 AmbientTalk not only supports traditional canonical syntax (e.g. ''o.m(a,b,c)'') but also keyworded syntax (e.g. ''o.at: key put: value'') for method definitions and message sends, as in SmallTalk. AmbientTalk not only supports traditional canonical syntax (e.g. ''o.m(a,b,c)'') but also keyworded syntax (e.g. ''o.at: key put: value'') for method definitions and message sends, as in SmallTalk.
 </note> </note>
Line 100: Line 100:
 </code> </code>
  
-<note important>+<note>
 In AmbientTalk, ''self'' and ''super'' indicate the current object and its parent respectively. While the former corresponds to a language keyword the latter is just a field name of the object. In AmbientTalk, ''self'' and ''super'' indicate the current object and its parent respectively. While the former corresponds to a language keyword the latter is just a field name of the object.
 </note> </note>
Line 119: Line 119:
 A message sent to an object using the ''^'' symbol (e.g. to the parent object in the example above) will start the method lookup in this object (and its parents) and then execute the method body in the lexical scope of the message sender (''self'' is bound to the message sender). A message sent to an object using the ''^'' symbol (e.g. to the parent object in the example above) will start the method lookup in this object (and its parents) and then execute the method body in the lexical scope of the message sender (''self'' is bound to the message sender).
  
-<note important+<note warning
-The ''.'' (dot) notation to send messages to ''super'' does not have the same semantics as the ''^'' delegation operatorThe ''.'' notation will not only start the method lookup in the object bound the ''super'' field but also bind the ''self'' pseudo variable to this object.+The delegation operator does not have the same semantics as the dot notationA message sent to ''super'' using the dot notation will not only start the method lookup in the object bound the ''super'' field but also bind the ''self'' pseudo variable to this object.
 </note> </note>
  
at/tutorial/objects.txt · Last modified: 2013/05/17 20:23 by tvcutsem