1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

allow (setcar nil nil)' and (setcdr nil nil)'

* module/language/elisp/runtime/subrs.scm (setcar, setcdr): Allow
  setting the car or cdr of `nil' to `nil'.

Signed-off-by: Andy Wingo <wingo@pobox.com>
This commit is contained in:
Brian Templeton 2010-07-22 16:25:29 -04:00 committed by Andy Wingo
parent b7966c10ef
commit b41a673d26

View file

@ -265,12 +265,16 @@
(built-in-func setcar
(lambda (cell val)
(prim set-car! cell val)
(if (and (null? cell) (null? val))
#nil
(prim set-car! cell val))
val))
(built-in-func setcdr
(lambda (cell val)
(prim set-cdr! cell val)
(if (and (null? cell) (null? val))
#nil
(prim set-cdr! cell val))
val))
;;; Accessing symbol bindings for symbols known only at runtime.