nil is null, whee
authorAndy Wingo <wingo@pobox.com>
Tue, 23 Mar 2010 19:29:22 +0000 (20:29 +0100)
committerAndy Wingo <wingo@pobox.com>
Tue, 30 Mar 2010 08:31:27 +0000 (10:31 +0200)
* libguile/pairs.h (scm_is_null): Nil is also null.

* libguile/vm-i-scheme.c (not, not-not, null?, not-null?):
* libguile/vm-i-system.c (br-if-null, br-if-not-null): Remove some more
  nil special cases.

libguile/pairs.h
libguile/vm-i-scheme.c
libguile/vm-i-system.c

index 81d89b5..090c9c1 100644 (file)
@@ -58,8 +58,8 @@
 # define scm_is_null_or_nil(x)  (scm_is_null_assume_not_nil (x))
 #endif
 
-/* XXX Should scm_is_null treat %nil as null by default? */
-#define scm_is_null(x)         (scm_is_null_and_not_nil(x))
+/* %nil is null. */
+#define scm_is_null(x)         (scm_is_null_or_nil(x))
 
 #define SCM_CAR(x)             (SCM_VALIDATE_PAIR (x, SCM_CELL_OBJECT_0 (x)))
 #define SCM_CDR(x)             (SCM_VALIDATE_PAIR (x, SCM_CELL_OBJECT_1 (x)))
index 1942a89..ecc77bd 100644 (file)
 VM_DEFINE_FUNCTION (128, not, "not", 1)
 {
   ARGS1 (x);
-  RETURN (scm_from_bool (scm_is_false_or_nil (x)));
+  RETURN (scm_from_bool (scm_is_false (x)));
 }
 
 VM_DEFINE_FUNCTION (129, not_not, "not-not", 1)
 {
   ARGS1 (x);
-  RETURN (scm_from_bool (!scm_is_false_or_nil (x)));
+  RETURN (scm_from_bool (!scm_is_false (x)));
 }
 
 VM_DEFINE_FUNCTION (130, eq, "eq?", 2)
@@ -56,13 +56,13 @@ VM_DEFINE_FUNCTION (131, not_eq, "not-eq?", 2)
 VM_DEFINE_FUNCTION (132, nullp, "null?", 1)
 {
   ARGS1 (x);
-  RETURN (scm_from_bool (scm_is_null_or_nil (x)));
+  RETURN (scm_from_bool (scm_is_null (x)));
 }
 
 VM_DEFINE_FUNCTION (133, not_nullp, "not-null?", 1)
 {
   ARGS1 (x);
-  RETURN (scm_from_bool (!scm_is_null_or_nil (x)));
+  RETURN (scm_from_bool (!scm_is_null (x)));
 }
 
 VM_DEFINE_FUNCTION (134, eqv, "eqv?", 2)
index 76ae069..c1d9491 100644 (file)
@@ -506,12 +506,12 @@ VM_DEFINE_INSTRUCTION (39, br_if_not_eq, "br-if-not-eq", 3, 0, 0)
 
 VM_DEFINE_INSTRUCTION (40, br_if_null, "br-if-null", 3, 0, 0)
 {
-  BR (scm_is_null_or_nil (*sp));
+  BR (scm_is_null (*sp));
 }
 
 VM_DEFINE_INSTRUCTION (41, br_if_not_null, "br-if-not-null", 3, 0, 0)
 {
-  BR (!scm_is_null_or_nil (*sp));
+  BR (!scm_is_null (*sp));
 }
 
 \f