mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* New macro SCM_TRUE_P.
* Use SCM_EQ_P to compare SCM values.
This commit is contained in:
parent
8b3bda2058
commit
dd039d6dc6
3 changed files with 18 additions and 8 deletions
|
@ -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))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue