Controlling member access

Static members are the syntactic equivalent of properties attached to a constructor function. They can exist only inside class definition blocks. Static members are propagated to subclasses. If a static member is present, an instance member may not be. Only static variables can be accessed inside static functions. Static variables can be accessed inside instance functions and off of instances of a class, but they may only be read, and not written to.

Static members are defined by specifying the static attribute for any class member.

Public or private members are defined by specifying the public or private attribute to any class member. If not specified, public is assumed.

Public and private members are compile-time-only feature. Combined with compile-time type checking, private can be enforced for variables of a known type. Also they specify whether or not meta information for a given member should be published as hidden or shown. How this information is used is up to the feature that is displaying the information. For example, while editing a form with a component instance, private members of the component may never be shown in the code editor hints to prevent users of the component from relying on internal members. The private attribute actually behaves as protected does in other object-oriented languages, so subclasses can access their parents' private variables.