X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=incore.lsp;h=5cd646b19c4890418daf6e3d92f1a9b9ee8becce;hb=120e642913c112063812821962efca7c4819d71d;hp=6ba256198cc8158007440ddc5490bb8eec7ea971;hpb=3dcbdf45070be29c4dec5217bcb141d8ee96ac47;p=rrq%2Fnewlisp%2Fpacknl.git diff --git a/incore.lsp b/incore.lsp index 6ba2561..5cd646b 100644 --- a/incore.lsp +++ b/incore.lsp @@ -8,12 +8,20 @@ ;; ;; archives:archives is a hashmap for loadable files ;; core:core is the running binary file -;; archive:main is the name of the first on-core member -;; archive:incore is the byte position into core for the archive +;; +;; The "archive" context holds utility code. +;; archive:main is the name of the first in-core member. +;; archive:incore is the byte position into core for the archive. +;; +;; Use (archives member pathname) to register that the file "member" +;; should be looked up in the ar style archive of the given pathname. +;; +;; Use (archive pathname) to register all members of the nominated ar +;; style archive. (new Tree 'archives) -(define core:core (read-file (main-args 0))) +(define core:core (read-file "/proc/self/exe")) (context 'archive) @@ -59,15 +67,15 @@ (constant 'load - (letex (LOAD load) + (letex ((LOAD load) (CTX '(or (and (1 (args)) (args 1)) MAIN))) (fn () (if (archives (args 0)) - (eval-string (archive:get $it (args 0)) MAIN) - (LOAD (args 0))))) + (eval-string (archive:get $it (args 0)) CTX) + (LOAD (args 0) CTX)))) 'read-file (letex (READ-FILE read-file) (fn () (if (archives (args 0)) (archive:get $it (args 0)) - (READ-FILE (args 0))))) + (READ-FILE (args 0))))) 'file? (letex (FILE? file?) (fn () (if (archives (args 0)) true (FILE? (args 0)))))