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 revisionBoth sides next revision
at:tutorial:objects [2007/07/10 22:27] – changed tvcutsemat:tutorial:objects [2007/07/10 22:29] – * tvcutsem
Line 203: Line 203:
 ===== Encapsulation ===== ===== Encapsulation =====
  
-AmbientTalk has no notion of "visibility modifiers" for fields or methods. All fields and methods of an object are considered "public". Nevertheless, a field or method can be made "private" to a scope by means of lexical scoping (a technique sometimes referred to as "lambda abstraction"). The following code shows the definition of an object inside the definition of a function. Although all of the object's fields and methods are public, the object can make use of lexically visible fields and methods of outer objects or functions which are not simply accessible "from the outside":+AmbientTalk has no notion of "visibility modifiers" for fields or methods. All fields and methods of an object are considered "public". Nevertheless, a field or method can be made "private" to a scope by means of lexical scoping (a technique sometimes referred to as [[http://www.erights.org/elib/capability/ode/ode-objects.html|lambda abstraction]]). The following code shows the definition of an object inside the definition of a function. Although all of the object's fields and methods are public, the object can make use of lexically visible fields and methods of outer objects or functions which are not simply accessible "from the outside":
  
 <code> <code>
at/tutorial/objects.txt · Last modified: 2013/05/17 20:23 by tvcutsem