To use a system on a machine where ALPM is not installed (e.g. an end user’s AutoCAD), generate a self-contained loader:
(alpm-generate-loader "geometry" "/home/pjb/lisp/geometry/geometry-loader.lsp" nil)
‘geometry-loader.lsp’ loads every source file, dependencies included, in the correct order, and requires nothing but the sources themselves. Regenerate it whenever the definition changes (it says so in its header).
The loader is self-locating: AutoCAD and BricsCAD offer no way to set search paths from a program and no way for a file to know where it is being loaded from, so the loader finds its base directory at run time by trying, in order: a ‘*geometry-loader-base*’ variable you may set before loading it; clautolisp’s ‘*AUTOLISP-LOAD-PATHNAME*’; ‘(findfile "geometry-loader.lsp")’ — which works when its directory is on the engine search path (set in the GUI) or is the current directory; the ALPM registry, when ALPM happens to be loaded; and finally the absolute path recorded at generation time. All source files are then loaded relative to that base, so the whole tree can be moved or deployed anywhere as one piece.
Loading the loader loads the system; it also defines ‘(load-geometry base)’ so you can reload later from an explicit directory:
(load "d:/deploy/geometry/geometry-loader.lsp") ; loads the system (load-geometry "d:/elsewhere/geometry") ; reload from another tree
If the system needs encoding conversion for the target engine (see Source File Encodings), generate a distribution instead: it copies the sources pre-converted and puts the loader inside the tree:
(alpm-generate-distribution "geometry" "d:/dist/geometry" "cp1252" nil)