summaryrefslogtreecommitdiff
path: root/libguile/boolean.h
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-03-29 01:15:56 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-03-29 01:15:56 +0000
commitdd039d6dc6e48d1eb9cc4b0601a431e19a334eaa (patch)
treeeb568f6a7ab1fba912c3baea37b2582ffebf9afe /libguile/boolean.h
parent8b3bda20581d305b3ec9f59eb7caa97ebe648fc2 (diff)
downloadguile-dd039d6dc6e48d1eb9cc4b0601a431e19a334eaa.tar.gz
* New macro SCM_TRUE_P.
* Use SCM_EQ_P to compare SCM values.
Diffstat (limited to 'libguile/boolean.h')
-rw-r--r--libguile/boolean.h15
1 files changed, 9 insertions, 6 deletions
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))))