From: David Vazquez Date: Wed, 13 Feb 2013 22:46:19 +0000 (+0000) Subject: FUNCALL accepts symbols as function descriptor X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=fd65b669013476e4fd4348dd4e415bc44b812966;p=jscl.git FUNCALL accepts symbols as function descriptor --- diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 5cbd13e..514e259 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -2231,11 +2231,13 @@ "string1.concat(string2)")) (define-raw-builtin funcall (func &rest args) - (code "(" (ls-compile func) ")(" - (join (cons (if *multiple-value-p* "values" "pv") - (mapcar #'ls-compile args)) - ", ") - ")")) + (js!selfcall + "var f = " (ls-compile func) ";" *newline* + "return (typeof f === 'function'? f: f.fvalue)(" + (join (cons (if *multiple-value-p* "values" "pv") + (mapcar #'ls-compile args)) + ", ") + ")")) (define-raw-builtin apply (func &rest args) (if (null args)