From 7e98e17ecc3ec0e34af74dfe88a2dc3fc492206e Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Fri, 25 Jan 2013 16:50:12 +0000 Subject: [PATCH] FUNCALL and APPLY can return multiple values --- ecmalisp.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 20a17b1..de2dabb 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -1863,7 +1863,8 @@ (define-raw-builtin funcall (func &rest args) (concat "(" (ls-compile func) ")(" - (join (cons "pv" (mapcar #'ls-compile args)) + (join (cons (if *multiple-value-p* "values" "pv") + (mapcar #'ls-compile args)) ", ") ")")) @@ -1874,7 +1875,8 @@ (last (car (last args)))) (js!selfcall "var f = " (ls-compile func) ";" *newline* - "var args = [" (join (cons "pv" (mapcar #'ls-compile args)) + "var args = [" (join (cons (if *multiple-value-p* "values" "pv") + (mapcar #'ls-compile args)) ", ") "];" *newline* "var tail = (" (ls-compile last) ");" *newline* -- 1.7.10.4