If you want to bind to an arbitrary global variable in the same object as the closure is being constructed in, it's simple:
[code] string x;
closure f;
x = whatever_variable_name;
f = lambda(({}),({#'write,({#'apply,symbol_variable(x) })}));
[/quote]
The key here is remembering to run the symbol returned by symbol_variable through apply or funcall.
|