Get a reference to a global object
Ref_Type __get_reference (String_Type nm)
This function returns a reference to a global variable or function
whose name is specified by nm. If no such object exists, it
returns NULL, otherwise it returns a reference.
For example, consider the function:
define runhooks (hook)
{
variable f;
f = __get_reference (hook);
if (f != NULL)
@f ();
}
This function could be called from another S-Lang function to
allow customization of that function, e.g., if the function
represents a mode, the hook could be called to setup keybindings
for the mode.
- slangrtl
-
__class_id,
__class_type,
__eqs,
__get_defined_symbols,
__is_initialized,
__pop_args,
__push_args,
__uninitialize,
_apropos,
_function_name,
_nargs,
_typeof,
array_info,
autoload,
dup,
eval,
evalfile,
getenv,
is_defined,
is_struct_type,
length,
make_printable_string,
set_slang_load_path,
typecast,
typeof
|