Revision [846]

Last edited on 2011-04-04 01:28:53 by Tolnaftate2004 [Namespaces/::]
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.
Deletions:
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.


Revision [671]

Edited on 2010-05-23 01:42:19 by Tolnaftate2004 [minor]
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:
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]] [[functions]] are used, both of which also have global scope.


Revision [665]

Edited on 2010-05-23 01:07:14 by Tolnaftate2004 [minor]
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:
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.


Revision [664]

Edited on 2010-05-23 01:05:44 by Tolnaftate2004 [Added "Within-script scope"]
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.


Revision [662]

Edited on 2010-05-23 01:01:57 by Tolnaftate2004 [minor (aesthetics)]
Additions:
~1) GS1-style event
~1) built-in ##[[this]]## variable
~1) ##[[temp]]## variable
~1) other ##[[this]]## variables
~1) global variables
Deletions:
-1) GS1-style event
-1) built-in ##[[this]]## variable
-1) [[temp]] variable
-1) other [[this]] variables
-1) global variables


Revision [661]

The oldest known version of this page was created on 2010-05-23 00:58:24 by Tolnaftate2004 [Creation]
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki