autoload_undefined_symbol
autoload_undefined_symbol — checks undefined symbols for
AutoLoad.
autoload_undefined_symbol (!sym)
symA symbol.
nil on success, else
error.
This function is generally used internally by the
AutoLoadLib.g program. It is the default function
that is called when an undefined symbol is encountered at run-time, if the
AutoLoad.g library has been required into the
program. This is normally done by startup.g, which is automatically loaded
by the Gamma executable at startup.
In this example, the first symbol (test1) is checked by
autoload_undefined_symbol from within the
AutoLoadLib.g program. We know this because the
message "Looking for
" indicates that Gamma
had to use symbolAutoLoadLib.g to get the definition of the
symbol. For the second symbol (test2), we make the
autoload_undefined_symbol call ourselves, and the
"Looking for
" doesn't appear. This
indicates that Gamma knew the value of the symbol and didn't have to use
symbolAutoLoadLib.g to look it up.
Gamma>AutoLoad("test1", `test1 = 9);(("test1" setq test1 9) ("P[Tthg]*" DllLoad "libgammaph.so")...)Gamma>test1;Looking for test1 9Gamma>AutoLoad("test2", `test2 = 8);(("test2" setq test2 8) ("test1" setq test1 9) ("P[Tthg]*" DllLoad "libgammaph.so")...)Gamma>autoload_undefined_symbol(test2);nilGamma>test2;8Gamma>