Migrate MULTIPLE-VALUE-PROG1
authorDavid Vázquez <davazp@gmail.com>
Fri, 5 Jul 2013 02:48:08 +0000 (04:48 +0200)
committerDavid Vázquez <davazp@gmail.com>
Fri, 5 Jul 2013 02:48:08 +0000 (04:48 +0200)
src/compiler.lisp

index 57248f7..9ff6cd7 100644 (file)
          `(return (call (get func "apply") |window| args))))))
 
 (define-compilation multiple-value-prog1 (first-form &rest forms)
-  (js!selfcall
-    "var args = " (ls-compile first-form *multiple-value-p*) ";"
-    (ls-compile-block forms)
-    "return args;" ))
+  (js!selfcall*
+    `(var (args ,(ls-compile first-form *multiple-value-p*)))
+    ;; TODO: Interleave is temporal
+    `(progn ,@(interleave (mapcar #'ls-compile forms)
+                          '(code ";")
+                          t))
+    `(return args)))
 
 (define-transformation backquote (form)
   (bq-completely-process form))