From 151f60e1e9d7c213eec8aa7670b96ed604ee74d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Thu, 25 Apr 2013 13:41:03 +0100 Subject: [PATCH] List the sources in only one place --- ecmalisp.lisp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) 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))))) -- 1.7.10.4