changed how to access the exe origin
[rrq/newlisp/packnl.git] / incore.lsp
index 6ba256198cc8158007440ddc5490bb8eec7ea971..5d0bef576c71e0932f4d69c6c244bea58b24b879 100644 (file)
@@ -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)
 
@@ -67,7 +75,7 @@
    (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)))))