diff options
author | Andy Wingo <wingo@pobox.com> | 2010-03-23 20:29:22 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-03-30 10:31:27 +0200 |
commit | 2533f10b40cdab357140347fe05e291f02bb5cb5 (patch) | |
tree | bca95f90c64419a6899ce13a31b1df0cbbcbdb9e | |
parent | d38b431ace4b01e5da9cb09bb6341277f2974160 (diff) | |
download | guile-2533f10b40cdab357140347fe05e291f02bb5cb5.tar.gz |
nil is null, whee
* 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.
-rw-r--r-- | libguile/pairs.h | 4 | ||||
-rw-r--r-- | libguile/vm-i-scheme.c | 8 | ||||
-rw-r--r-- | libguile/vm-i-system.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/libguile/pairs.h b/libguile/pairs.h index 81d89b56b..090c9c13e 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -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))) diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c index 1942a8985..ecc77bdee 100644 --- a/libguile/vm-i-scheme.c +++ b/libguile/vm-i-scheme.c @@ -32,13 +32,13 @@ 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) diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 76ae0691d..c1d949139 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -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)); } |