From: David Vazquez Date: Sat, 22 Dec 2012 04:49:15 +0000 (+0000) Subject: Copy global environment from host to target X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ed163dc3d1bbef310f78d3bbeb3b3d1a7f13e034;p=jscl.git Copy global environment from host to target --- diff --git a/test.lisp b/test.lisp index b7662fb..bd42ad3 100644 --- a/test.lisp +++ b/test.lisp @@ -2,9 +2,9 @@ (eval-when-compile (%compile-defmacro 'defmacro - (lambda (name args &rest body) + '(lambda (name args &rest body) `(eval-when-compile - (%compile-defmacro ',name (lambda ,args ,@body)))))) + (%compile-defmacro ',name '(lambda ,args ,@body)))))) (defmacro defvar (name value) `(progn @@ -945,12 +945,13 @@ (ls-compile-file "lispstrack.lisp" "lispstrack.js"))) - (defun eval (x) (js-eval (ls-compile x nil nil))) - -(debug (apply #'+ 1 '(2))) - -;; (with-compilation-unit -;; (debug (ls-compile (quote (function 1+)) nil nil))) +;;; Set the initial global environment to be equal to the host global +;;; environment at this point of the compilation. +(eval-when-compile + (let ((c1 (ls-compile `(setq *fenv* ',*fenv*) nil nil)) + (c2 (ls-compile `(setq *env* ',*env*) nil nil))) + (setq *toplevel-compilations* + (append *toplevel-compilations* (list c1 c2)))))