From: David Vázquez Date: Thu, 25 Apr 2013 12:41:03 +0000 (+0100) Subject: List the sources in only one place X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=151f60e1e9d7c213eec8aa7670b96ed604ee74d5;p=jscl.git List the sources in only one place --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index b412d21..45b22f9 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -17,11 +17,18 @@ ;; along with this program. If not, see . (eval-when (:load-toplevel :compile-toplevel :execute) - (load "compat") - (load "utils") - (load "print") - (load "read") - (load "compiler")) + (defvar *source* + '(("boot.lisp" :target) + ("compat" :host) + ("utils.lisp" :both) + ("print.lisp" :both) + ("read.lisp" :both) + ("compiler.lisp" :both) + ("toplevel.lisp" :target))) + + (dolist (input *source*) + (when (member (cadr input) '(:host :both)) + (load (car input))))) (defun read-whole-file (filename) (with-open-file (in filename) @@ -51,10 +58,6 @@ *block-counter* 0) (with-open-file (out "ecmalisp.js" :direction :output :if-exists :supersede) (write-string (read-whole-file "prelude.js") out) - (dolist (file '("boot.lisp" - "utils.lisp" - "print.lisp" - "read.lisp" - "compiler.lisp" - "toplevel.lisp")) - (ls-compile-file file out)))) + (dolist (input *source*) + (when (member (cadr input) '(:target :both)) + (ls-compile-file (car input) out)))))