From: David Vázquez Date: Fri, 5 Jul 2013 02:38:56 +0000 (+0200) Subject: Migrate CONS X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=d537b422f2b831001fc01d85cc612173432a4c93;p=jscl.git Migrate CONS --- diff --git a/src/compiler.lisp b/src/compiler.lisp index d939651..6d24adf 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1071,9 +1071,10 @@ (define-builtin consp (x) (js!bool - (js!selfcall - "var tmp = " x ";" - "return (typeof tmp == 'object' && 'car' in tmp);" ))) + (js!selfcall* + `(var (tmp ,x)) + `(return (and (== (typeof tmp) "object") + (in "car" tmp)))))) (define-builtin car (x) (js!selfcall*