From: David Vázquez Date: Sun, 23 Jun 2013 00:24:44 +0000 (+0200) Subject: Migrate some more primitives X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c26d6b762ec8713d869b003619d733748045d132;p=jscl.git Migrate some more primitives --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 36eac60..224d237 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1326,16 +1326,16 @@ "return tmp === undefined? " (ls-compile nil) " : tmp;" ))) (define-raw-builtin oget (object key &rest keys) - `(code "js_to_lisp(" ,(ls-compile `(oget* ,object ,key ,@keys)) ")")) + `(call js_to_lisp ,(ls-compile `(oget* ,object ,key ,@keys)))) (define-raw-builtin oset (value object key &rest keys) (ls-compile `(oset* (lisp-to-js ,value) ,object ,key ,@keys))) (define-builtin objectp (x) - (js!bool `(code "(typeof (" ,x ") === 'object')"))) + (js!bool `(=== (typeof ,x) "object"))) -(define-builtin lisp-to-js (x) `(code "lisp_to_js(" ,x ")")) -(define-builtin js-to-lisp (x) `(code "js_to_lisp(" ,x ")")) +(define-builtin lisp-to-js (x) `(call lisp_to_js ,x)) +(define-builtin js-to-lisp (x) `(code js_to_lisp ,x)) (define-builtin in (key object)