Visibility and Mutability

One of the new features provided by the new compiler and source format is the ability to apply modifiers to features, scripts and functions that modify their visibility to other objects, and prevent other objects from overriding them. By adding restrictions in this manner, it becomes easier to separate implementation from interface, making it safer to change underlying details without putting other modules at risk of breaking.

Public

The default modifier, a Public feature, function or script can be modified or overridden by any other object.

Overrides

The Overrides modifier indicates that this feature is not defining a new feature, function or script, but is overriding the value or behaviour of one defined on a parent object. This guards against accidentally replacing a feature, function or script.

An overridden feature or function has some constraints. A replacement feature should be of the same or more restrictive type (e.g. a Dynamic feature may be overridden by an Integer one, but not the other way around) than the feature that is being overridden—in most cases, this means that all that is allowed to change is the value.

A replacement function should have a return value that is the same or more restrictive type, and its parameters should be of the same or less restrictive types. Additional parameters are allowed, provided that they all have default values. A general rule of thumb is that the new function definition must be valid in all circumstances where the old function could be used.

Private

The Private keyword currently has no effect, but can be used to mark functions or features that should not be accessed by other objects or modules.