AutoLoad ("pattern", `action)
The _auto_load_alist_, which is a list of all currently stored AutoLoad rules. Each rule is itself formatted as a list. This is the _auto_load_alist_ syntax:
((pattern action_func action_arg ...) ...)
The members of each rule list are as follows:
For example, the AutoLoad rules in AutoLoadLib.g (at the time of this writing) would be returned as follows:
(("P[Tthg]*" DllLoad "libgammaph.so") ("gl[A-Z]*" DllLoad "libgammagl.so")
("GLUT_*" DllLoad "libgammagl.so") ("GLU_*" DllLoad "libgammagl.so")
("GL_*" DllLoad "libgammagl.so") ("ASCII_*" DllLoad "libgammamgl.so")
("KB_*" DllLoad "libgammamgl.so") ("GM_*" DllLoad "libgammamgl.so")
("EVT_*" DllLoad "libgammamgl.so") ("[mM][gG][lL]*" DllLoad "libgammamgl.so")
("[gG]tk*" DllLoad "gammagtk.so"))This function gives Gamma a way to look up symbols during run-time. If Gamma comes across an undefined symbol while executing a program, and if the symbol matches the pattern, then Gamma executes the action. Normally the action is either a direct definition of the symbol, or an attempt to load a DLL that defines the symbol, using DllLoad, for example.
The available patterns are as follows:
![]() | This function is not part of the base Gamma executable. It is provided by a Gamma library AutoLoadLib.g which can be accessed using the Gamma require function like this: require ("/usr/cogent/require/AutoLoadLib.g"); |
![]() |
|
Gamma> require ("/usr/cogent/require/AutoLoadLib.g");
t
Gamma> ClearAutoLoad();
nil
Gamma> AutoLoad ("[gG]tk*", `DllLoad ("gammagtk.so"));
(("[gG]tk*" DllLoad "gammagtk.so"))
Gamma> gtk_arg_new;
Looking for gtk_arg_new
(defun gtk_arg_new (arg_type) ...)
Gamma> gtk_main;
(defun gtk_main () ...)
Gamma> testvar;
Looking for testvar
Symbol is undefined: testvar
debug 1> (Ctrl - D)
Gamma> AutoLoad("testvar", `testvar = 5);
(("testvar" setq testvar 5) ("[gG]tk*" DllLoad "gammagtk.so"))
Gamma> testvar;
Looking for testvar
5
Gamma> NoAutoLoad("testvar");
(("[gG]tk*" DllLoad "gammagtk.so"))
Gamma> testvar;
5
Gamma> ClearAutoLoad();
nil
Gamma> gtk_main;
(defun gtk_main () ...)
Gamma> gtk_false;
(defun gtk_false () ...)
Gamma>
Copyright © 1995-2006 by Cogent Real-Time Systems, Inc. All rights reserved.