at:tutorial:objects
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:objects [2007/06/27 12:28] – jorge | at:tutorial:objects [2007/06/27 14:28] – jorge | ||
---|---|---|---|
Line 21: | Line 21: | ||
</ | </ | ||
- | As all definitions in AmbientTalk, | + | As all definitions in AmbientTalk, |
- | This object can be instantiated to create new points as follows: | + | |
+ | <note important> | ||
+ | Note that AmbientTalk not only supports traditional canonical syntax (e.g. '' | ||
+ | </ | ||
+ | |||
+ | In the example above, the state of the '' | ||
< | < | ||
Line 31: | Line 36: | ||
Every object understands the message '' | Every object understands the message '' | ||
- | Object' | + | ===== Sending messages ===== |
+ | In AmbientTalk, | ||
+ | |||
+ | access to | ||
+ | |||
+ | access to the fields and methods of the objects. | ||
+ | |||
+ | Object' | ||
< | < | ||
Line 38: | Line 50: | ||
> aPoint.sumOfSquares() | > aPoint.sumOfSquares() | ||
>>13 | >>13 | ||
- | > aPoint.x := 4 | ||
- | >>4 | ||
- | > aPoint.sumOfSquares() | ||
- | >>25 | ||
</ | </ | ||
- | |||
- | ===== Sending messages ===== | ||
- | In AmbientTalk, | ||
- | Note that AmbientTalk supports both traditional canonical syntax (e.g. o.m(a,b,c)) as well as keyworded syntax (e.g. o.at: key put: value) for method definitions and message sends. | ||
===== Cloning and instantiation ===== | ===== Cloning and instantiation ===== |
at/tutorial/objects.txt · Last modified: 2013/05/17 20:23 by tvcutsem