diff options
author | Greg J. Badros <gjb@cs.washington.edu> | 1999-12-12 19:09:46 +0000 |
---|---|---|
committer | Greg J. Badros <gjb@cs.washington.edu> | 1999-12-12 19:09:46 +0000 |
commit | a9967b3dbf03af3e508a5a144056ba57d7bf1be0 (patch) | |
tree | cfc4c5ce3f9b6d288816e8784d776c69434dc0c0 /libguile/boolean.h | |
parent | a30fd2675363a05bc74d6336ae6f467a361eff8f (diff) | |
download | guile-a9967b3dbf03af3e508a5a144056ba57d7bf1be0.tar.gz |
* boolean.h: Added SCM_BOOL, SCM_NEGATE_BOOL, SCM_BOOLP to here,
from scm_validate.h.
* scm_validate.h: Moved above out into boolean.h, fix typo in
SCM_VALIDATE_NIM macro.
Diffstat (limited to 'libguile/boolean.h')
-rw-r--r-- | libguile/boolean.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libguile/boolean.h b/libguile/boolean.h index 52a28b559..59c7df218 100644 --- a/libguile/boolean.h +++ b/libguile/boolean.h @@ -53,6 +53,14 @@ #define SCM_FALSEP(x) (SCM_BOOL_F == (x)) #define SCM_NFALSEP(x) (SCM_BOOL_F != (x)) +#define SCM_BOOLP(x) ((x) == SCM_BOOL_T || (x) == SCM_BOOL_F) + +/* Convert from a C boolean to a SCM boolean value */ +#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) + /* SCM_BOOL_NOT returns the other boolean. * The order of ^s here is important for Borland C++ (!?!?!) */ |