script objects created in scripts are internally represented by the HeadFuncNode
class from the Delta Time
library.
For an arbitrary script object named S, functions of the form S.func_name(parameters) -> return_type are value-returning functions, while functions of the form S.func_name(parameters); are void functions, which perform an action but return nothing.
-
S.run(A) -> R
Runs the child script
Sfrom a parent script and returns the result of the child script execution as some valueR.Ais a placeholder for zero or more comma-separated arguments passed into the script.It is assumed that the writer of the parent script knows the type signature of
S, and that:- any arguments
Amatch the parameters ofS's header function Sreturns a valueRis treated as an instance ofS's return type in the parent script
Failure to comply with any of these assertions will result in a runtime error.
- any arguments
-
S.run(A);
Runs the child script
Sfrom a parent script.Ais a placeholder for zero or more comma-separated arguments passed into the script.It is assumed that the writer of the parent script knows the type signature of
S. Passing a series of argumentsAintoSthat does not match the parameters ofS's header function will result in a runtime error.Note:
Void
run()can be called on a child scriptSthat has a return type; the value returned bySwill simply be ignored.
Read more: