X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=514e25991baf2cfc591ad5a8d9af95f59cb33395;hb=fd65b669013476e4fd4348dd4e415bc44b812966;hp=9e17b2b9788462cc2402d7abf3b47c7e1cd8fa67;hpb=884a8d2eb7de40b55fbe31bc121ab1ff9392e351;p=jscl.git diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 9e17b2b..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) @@ -2450,7 +2452,7 @@ fset funcall function functionp gensym get-universal-time go identity if in-package incf integerp integerp intern keywordp labels lambda last length let let* - list-all-packages list listp make-array make-package + list-all-packages list listp loop make-array make-package make-symbol mapcar member minusp mod multiple-value-bind multiple-value-call multiple-value-list multiple-value-prog1 nil not nth nthcdr null numberp or