script
script
’s correspondent type in the Stippe Effect source code is the Delta Time class HeadFuncNode
.
Functions
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.
run
-
S.run(A) -> R
Runs the child script
S
from a parent script and returns the result of the child script execution as some valueR
.A
is 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
A
match the parameters ofS
’s header function S
returns a valueR
is 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
S
from a parent script.A
is 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 argumentsA
intoS
that does not match the parameters ofS
’s header function will result in a runtime error.Note:
Void
run()
can be called on a child scriptS
that has a return type; the value returned byS
will simply be ignored.
Reading material: