at:tutorial:multiparadigm
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
at:tutorial:multiparadigm [2008/09/15 16:58] – tvcutsem | at:tutorial:multiparadigm [2011/06/07 18:29] (current) – *minor tvcutsem | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== On Scoping, Closures, Methods and Messages ====== | ====== On Scoping, Closures, Methods and Messages ====== | ||
- | This tutorial chapter goes into a bit more detail on the subtle | + | This tutorial chapter goes into a bit more detail on the interplay between AmbientTalk' |
===== Lexical Scope vs Object Scope ===== | ===== Lexical Scope vs Object Scope ===== | ||
Line 13: | Line 13: | ||
- Qualified access to a variable, e.g. '' | - Qualified access to a variable, e.g. '' | ||
- | These rules also hold for method invocation: the invocation '' | + | These rules also hold for method invocation: the invocation '' |
- | Probably the most important consequence of these rules is that great care has to be taken when an object accesses its own fields or methods. It can now do so in two ways. For example: | + | The most important consequence of these rules is that one should think carefully about how an object accesses its own fields or methods. It can now do so in two ways. For example: |
< | < | ||
Line 48: | Line 48: | ||
<note important> | <note important> | ||
- | For many object-oriented programmers, | + | For many object-oriented programmers, |
+ | |||
+ | The confusion stems from the fact that many OO languages -- like Java -- make no distinction between both access forms. For example, in Java, if one writes '' | ||
</ | </ | ||
Line 182: | Line 184: | ||
</ | </ | ||
- | < | + | < |
External methods, while powerful, introduce many subtle issues in the language. Therefore, this feature may disappear from later releases of AmbientTalk. It is therefore wise to stay clear from using this feature. For an overview of the problem introduced by external field or method declarations, | External methods, while powerful, introduce many subtle issues in the language. Therefore, this feature may disappear from later releases of AmbientTalk. It is therefore wise to stay clear from using this feature. For an overview of the problem introduced by external field or method declarations, | ||
</ | </ |
at/tutorial/multiparadigm.1221490706.txt.gz · Last modified: 2008/09/15 16:58 (external edit)