diff --git a/libguile/ChangeLog b/libguile/ChangeLog index b6a537e33..7c4f4d23d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2000-03-29 Dirk Herrmann + + * boolean.h (SCM_TRUE_P): New macro. + + * boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP), pairs.h + (SCM_NULLP, SCM_NNULLP): Use SCM_EQ_P to compare SCM values. + 2000-03-28 Dirk Herrmann * continuations.h (SCM_CONTREGS, SCM_SET_CONTREGS): New macros to diff --git a/libguile/boolean.h b/libguile/boolean.h index 8408a968a..e27c56f4b 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -50,21 +50,24 @@ /* Boolean Values * */ -#define SCM_FALSEP(x) (SCM_BOOL_F == (x)) -#define SCM_NFALSEP(x) (SCM_BOOL_F != (x)) +#define SCM_TRUE_P(x) (SCM_EQ_P ((x), SCM_BOOL_T)) +#define SCM_FALSEP(x) (SCM_EQ_P ((x), SCM_BOOL_F)) +#define SCM_NFALSEP(x) (!SCM_FALSEP (x)) -#define SCM_BOOLP(x) ((x) == SCM_BOOL_T || (x) == SCM_BOOL_F) +#define SCM_BOOLP(x) (SCM_TRUE_P (x) || SCM_FALSEP (x)) /* Convert from a C boolean to a SCM boolean value */ -#define SCM_BOOL(f) ((f)? SCM_BOOL_T : SCM_BOOL_F) +#define SCM_BOOL(f) ((f) ? SCM_BOOL_T : SCM_BOOL_F) /* Convert from a C boolean to a SCM boolean value and negate it */ -#define SCM_NEGATE_BOOL(f) ((f)? SCM_BOOL_F : SCM_BOOL_T) +#define SCM_NEGATE_BOOL(f) ((f) ? SCM_BOOL_F : SCM_BOOL_T) /* SCM_BOOL_NOT returns the other boolean. * The order of ^s here is important for Borland C++ (!?!?!) */ -#define SCM_BOOL_NOT(x) SCM_PACK(SCM_UNPACK(x) ^ (SCM_UNPACK (SCM_BOOL_T) ^ SCM_UNPACK (SCM_BOOL_F))) +#define SCM_BOOL_NOT(x) (SCM_PACK (SCM_UNPACK (x) \ + ^ (SCM_UNPACK (SCM_BOOL_T) \ + ^ SCM_UNPACK (SCM_BOOL_F)))) diff --git a/libguile/pairs.h b/libguile/pairs.h index b07225698..96b0e47d7 100644 --- a/libguile/pairs.h +++ b/libguile/pairs.h @@ -52,8 +52,8 @@ -#define SCM_NULLP(x) (SCM_EOL == (x)) -#define SCM_NNULLP(x) (SCM_EOL != (x)) +#define SCM_NULLP(x) (SCM_EQ_P ((x), SCM_EOL)) +#define SCM_NNULLP(x) (!SCM_NULLP (x)) #define SCM_CAR(x) (SCM_CELL_OBJECT_0 (x)) #define SCM_CDR(x) (SCM_CELL_OBJECT_1 (x))