Export compile and compileString too
authorDavid Vazquez <davazp@gmail.com>
Sat, 22 Dec 2012 05:17:55 +0000 (05:17 +0000)
committerDavid Vazquez <davazp@gmail.com>
Sat, 22 Dec 2012 05:17:55 +0000 (05:17 +0000)
test.lisp

index 737165a..b18e571 100644 (file)
--- a/test.lisp
+++ b/test.lisp
 (defmacro with-compilation-unit (&rest body)
   `(progn
      (setq *compilation-unit-checks* nil)
-     ,@body
-     (dolist (check *compilation-unit-checks*)
-       (funcall check))
-     (setq *compilation-unit-checks* nil)))
+     (prog1 (progn ,@body)
+       (dolist (check *compilation-unit-checks*)
+         (funcall check))
+       (setq *compilation-unit-checks* nil))))
 
 
 #+common-lisp
     (setq *toplevel-compilations*
           (append *toplevel-compilations* (list c1 c2)))))
 
-
 (js-eval
  (concat "var lisp = {};"
-         "lisp.eval = " (lookup-function-translation 'eval nil) ";" *newline*
          "lisp.read = " (lookup-function-translation 'ls-read-from-string nil) ";" *newline*
+         "lisp.eval = " (lookup-function-translation 'eval nil) ";" *newline*
+         "lisp.compile = " (lookup-function-translation 'ls-compile-toplevel nil) ";" *newline*
          "lisp.evalString = function(str){" *newline*
          "   return lisp.eval(lisp.read(str));" *newline*
+         "}" *newline*
+         "lisp.compileString = function(str){" *newline*
+         "   return lisp.compile(lisp.read(str));" *newline*
          "}" *newline*))