Skip to content

The Reflection Standard Library

C272 edited this page Aug 30, 2019 · 2 revisions

Library which allows for the creation and manipulation of variables at runtime.


gvar(x)

Gets the value of a variable given it's name.

Parameters:

Name Description
x The variable name to fetch.

Usage:

let x = 3;
print gvar("x"); //3

cvar(x, val)

Creates a variable given it's name.

Parameters:

Name Description
x The variable name to create.
val The value to assign the variable.

Usage:

cvar("x", 3);
print x; //3

svar(x, val)

Sets the value of a variable given it's name.

Parameters:

Name Description
x The variable name to set.
val The value to assign to the variable.

Usage:

let x = 3;
svar("x", 5);
print x; //5

dvar(x)

Deletes an existing variable.

Parameters:

Name Description
x The variable name to delete.

Usage:

let x = 3;
dvar("x");
print x; //error, x no longer exists