RPLAC[AD] should return their first argument, not the second
authorOwen Rodley <Strigoides@gmail.com>
Sun, 7 Jul 2013 21:32:54 +0000 (09:32 +1200)
committerOwen Rodley <Strigoides@gmail.com>
Sun, 7 Jul 2013 21:32:54 +0000 (09:32 +1200)
src/compiler.lisp

index 1c0bad1..51fb547 100644 (file)
                 (get tmp "cdr")))))
 
 (define-builtin rplaca (x new)
-  `(= (get ,x "car") ,new))
+  `(selfcall
+     (var (tmp ,x))
+     (= (get tmp "car") ,new)
+     (return tmp)))
 
 (define-builtin rplacd (x new)
-  `(= (get ,x "cdr") ,new))
+  `(selfcall
+     (var (tmp ,x))
+     (= (get tmp "cdr") ,new)
+     (return tmp)))
 
 (define-builtin symbolp (x)
   `(bool (instanceof ,x |Symbol|)))