From ed163dc3d1bbef310f78d3bbeb3b3d1a7f13e034 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Sat, 22 Dec 2012 04:49:15 +0000 Subject: [PATCH] Copy global environment from host to target --- test.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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))))) -- 1.7.10.4