mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
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.
This commit is contained in:
parent
d38b431ace
commit
2533f10b40
3 changed files with 8 additions and 8 deletions
|
@ -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)))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue