Scope modifiers: Difference between revisions

Added Delphi example
(Added Delphi example)
Line 133:
 
The stars around <code>*bug*</code> are only good style; they are no requirement of the language. Lispers like to put stars on special variables.
 
=={{header|Delphi}}==
<lang Delphi>private</lang>
Can only be seen inside declared class.
 
 
<lang Delphi>protected</lang>
Can be seen in descendent classes.
 
 
<lang Delphi>public</lang>
Can be seen from outside the class.
 
 
<lang Delphi>protected</lang>
Same visibility as Public, but run time type information (RTTI) is generated, allowing these members to be viewed dynamically. Members need to be published in order to be streamed or shown in the Object Inspector.
 
 
<lang Delphi>automated</lang>
Same visibility as Public, and used for Automation Objects. This is currently only maintained for backward compatibility.
 
 
<lang Delphi>strict private
strict protected</lang>
Private and Protected members of a class are visible to other classes declared in the same unit. The "strict" modifier was added in Delphi 2005 to treat public and private members as private and protected, even from classes declared in the same unit.
 
 
=={{header|E}}==
E has no scope modifiers; all variables (including function definitions) are lexical. When more than one file is involved, all import/export of definitions is handled by explicit return values, parameters, or reified environments.
 
 
=={{header|Ela}}==
Anonymous user