X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=incore.lsp;h=2847b54fb101dae94412b1c0504cbf18c54cd204;hb=f7ce63a2e4c452dacf688640f0810a4cfe888ed8;hp=8f24187ef6b449daeaf2f27e404c40c80ed4aef4;hpb=3d9f1b9bbb7fa4b1c67c4d3c7158bbe257133241;p=rrq%2Fnewlisp%2Fpacknl.git diff --git a/incore.lsp b/incore.lsp index 8f24187..2847b54 100644 --- a/incore.lsp +++ b/incore.lsp @@ -47,7 +47,7 @@ ))) ;; Read a member of an external archive -(define (get-stdin CMD) +(define (get-stdout CMD) (let ((I (pipe)) (O (pipe)) (DATA "") (ALL "") (SUB (fn (I O) (map close (list (I 1) (O 0) 0)) @@ -64,8 +64,8 @@ (define (get PATH MEMBER) (if (list? PATH) ((PATH 0) (PATH 1) core) (directory? PATH) (read-file (format "%s/%s" PATH MEMBER)) - (ends-with PATH ".a") (get-stdin (format "%s p %s %s" AR PATH MEMBER)) - (tar-able PATH) (get-stdin (format "%s xOf %s %s" TAR PATH MEMBER)) + (ends-with PATH ".a") (get-stdout (format "%s p %s %s" AR PATH MEMBER)) + (tar-able PATH) (get-stdout (format "%s xOf %s %s" TAR PATH MEMBER)) )) ;; Discover and load an in-core archive by means of a marker row of 40 @@ -85,17 +85,17 @@ (constant 'load - (letex ((LOAD load) (CTX '(or (and (1 (args)) (args 1)) MAIN))) + (letex ((LOAD load) (CTX '(if (1 (args)) (args 1)) MAIN)) (fn () (if (archives (args 0)) (eval-string (archive:get $it (args 0)) CTX) (LOAD (args 0) CTX)))) 'read-file - (letex (READ-FILE read-file) + (letex ((READ-FILE read-file) (CTX '(if (1 (args)) (args 1)) MAIN)) (fn () - (if (archives (args 0)) (archive:get $it (args 0)) + (if (archives (args 0)) (archive:get $it (args 0) CTX) (READ-FILE (args 0))))) 'file? - (letex (FILE? file?) + (letex ((FILE? file?)) (fn () (if (archives (args 0)) true (FILE? (args 0))))) )