GENERATE/PREV.gifGENERATE/NEXT.gif

Computed Property Access

Two built-in functions allow you to abstract over property access using computed property names:

getProperty <obj> <property_name>

setProperty <obj> <property_name> <val>

The property name can be either a name, for example #length, or a string, for example "length", so you can construct property names with string operations.

Examples:

getProperty foo #x      -- equiv. to foo.x

setProperty $foo "radius" 23      -- equiv. to $foo.radius = 23

getProperty $foo.ffd_2x2x2 ("control_point_" + n as string)