Dynamic variable names
var name = read("Enter a variable name: ", String); # type in 'foo'
class DynamicVar(name, value) {
method init {
DynamicVar.def_method(name, ->(_) { value })
}
}
var v = DynamicVar(name, 42); # creates a dynamic variable
say v.foo; # retrieves the valueLast updated