Additions:
Any function that is not qualified by [[public]] is accessible only by the script to which it belongs except in the case of classes. The [[public]] keyword grants a function global scope.
==Namespaces==
A very special type of "global" scope comes in the form of public functions inherited from a class, which are accessible via ##namespace::function## as well as by ##object.function##. Use of the former should conform to the principle of [[FunctionPurity function purity]]. The operator ##::## is called the namespace operator.
==Namespaces==
A very special type of "global" scope comes in the form of public functions inherited from a class, which are accessible via ##namespace::function## as well as by ##object.function##. Use of the former should conform to the principle of [[FunctionPurity function purity]]. The operator ##::## is called the namespace operator.
Deletions:
Additions:
Global scope in GraalScript is a sort of misnomer, in that a variable with global scope is only accessible to objects in the player's vicinity. An example might be ##i=0;## where i has not been defined previously. This variable is now available to any weapon on the [[player]], or any level [[TServerNPC NPC]] (granted that the codes accessing them are also on the same side [ie., server- or clientside] as the variable definition), and can be modified by any of them. For this reason, global variables of this type are used infrequenctly, and instead ##[[this]]## variables and [[public]] [[function functions]] are used, both of which also have global scope.
Deletions:
Additions:
The collection of objects that another object can "see" is called the //scope// of that object (by see, it is meant that some aspect of the object can be accessed, but does not assume that it can be modified). Scoping in GraalScript (as of the advent of new GraalScript) is similar to that seen in ECMAScript, that is, that a [[temp temporary]] variable is visible from any part of a [[function function's]] body.
Deletions:
Additions:
==Within-script scope==
Any function that is not qualified by [[public]] is accessible only by the script to which it belongs. The [[public]] keyword grants a function global scope.
Any function that is not qualified by [[public]] is accessible only by the script to which it belongs. The [[public]] keyword grants a function global scope.
Additions:
~1) GS1-style event
~1) built-in ##[[this]]## variable
~1) ##[[temp]]## variable
~1) other ##[[this]]## variables
~1) global variables
~1) built-in ##[[this]]## variable
~1) ##[[temp]]## variable
~1) other ##[[this]]## variables
~1) global variables
Deletions:
-1) built-in ##[[this]]## variable
-1) [[temp]] variable
-1) other [[this]] variables
-1) global variables