From: David Vázquez Date: Fri, 5 Jul 2013 02:53:05 +0000 (+0200) Subject: Migrate VARIABLE-ARITMETIC-CALL X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=3a3391372f9f3e70e1e32b0c44e7011b0922c03c;p=jscl.git Migrate VARIABLE-ARITMETIC-CALL --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 9ff6cd7..f9c1cd2 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -981,15 +981,17 @@ (fargs '()) (prelude '())) (dolist (x args) - (cond - ((or (floatp x) (numberp x)) (push x fargs)) - (t (let ((v (make-symbol (code "x" (incf counter))))) - (push v fargs) - (push `(code "var " ,v " = " ,(ls-compile x) ";" - "if (typeof " ,v " !== 'number') throw 'Not a number!';") - prelude))))) - (js!selfcall - `(code ,@(reverse prelude)) + (if (or (floatp x) (numberp x)) + (push x fargs) + (let ((v (make-symbol (concat "x" (integer-to-string (incf counter)))))) + (push v fargs) + (push `(var (,v ,(ls-compile x))) + prelude) + (push `(if (!= (typeof ,v) "number") + (throw "Not a number!")) + prelude)))) + (js!selfcall* + `(progn ,@(reverse prelude)) (funcall function (reverse fargs)))))