From: David Vázquez Date: Sun, 23 Jun 2013 19:44:51 +0000 (+0200) Subject: Migrate FUNCTIONP, %WRITE-STRING and /DEBUG X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=28a70142483b776481c771a749999dba20676357;p=jscl.git Migrate FUNCTIONP, %WRITE-STRING and /DEBUG --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 57a7e79..3d31ab2 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1228,16 +1228,16 @@ `(code "globalEval(xstring(" ,string "))"))) (define-builtin %throw (string) - (js!selfcall "throw " string ";" )) + (js!selfcall* `(throw ,string))) (define-builtin functionp (x) - (js!bool `(code "(typeof " ,x " == 'function')"))) + (js!bool `(=== (typeof ,x) "function"))) (define-builtin %write-string (x) - `(code "lisp.write(" ,x ")")) + `(call (get |lisp| "write") ,x)) (define-builtin /debug (x) - `(code "console.log(xstring(" ,x "))")) + `(call (get |console| "log") (call |xstring| ,x))) ;;; Storage vectors. They are used to implement arrays and (in the