summaryrefslogtreecommitdiff
path: root/libguile/deprecated.h
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-07-27 15:39:25 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-07-27 15:39:25 +0000
commit2ad58b2a89598490f27813caa5a6da66cc1593a0 (patch)
tree9de973d2a9da61f89df2880df4c9f97d941bc80f /libguile/deprecated.h
parente759bc7c331a19d0389aa9471febb39746680011 (diff)
downloadguile-2ad58b2a89598490f27813caa5a6da66cc1593a0.tar.gz
* deprecated.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
Reimplement using scm_is_false, scm_is_true, scm_is_bool, and scm_from_bool, respectively. (SCM_NINUMP): Added. * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into deprecated.h. Replaced all uses with scm_is_eq.
Diffstat (limited to 'libguile/deprecated.h')
-rw-r--r--libguile/deprecated.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 8b89fec78..2794a50b8 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -77,7 +77,7 @@ SCM_API const char scm_s_formals[];
/* From eval.h: Helper macros for evaluation and application. These were
* deprecated in guile 1.7.0 on 2003-06-02. */
#define SCM_EVALIM2(x) \
- ((SCM_EQ_P ((x), SCM_EOL) \
+ ((scm_is_eq ((x), SCM_EOL) \
? scm_misc_error (NULL, scm_s_expression, SCM_EOL), 0 \
: 0), \
(x))
@@ -305,16 +305,22 @@ SCM_API SCM scm_gentemp (SCM prefix, SCM obarray);
#define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits*)SCM_CELL_OBJECT_LOC((x),(n)))
-#define SCM_FALSEP(x) (SCM_EQ_P ((x), SCM_BOOL_F))
-#define SCM_NFALSEP(x) (!SCM_FALSEP (x))
+/* Deprecated because they do not follow the naming convention. that
+ is, they endiin "P" but return a C boolean. Also, SCM_BOOLP
+ evaluates its argument twice.
+*/
+
+#define SCM_FALSEP scm_is_false
+#define SCM_NFALSEP scm_is_true
+#define SCM_BOOLP scm_is_bool
+#define SCM_EQ_P scm_is_eq
-#define SCM_BOOLP(x) (SCM_EQ_P ((x), SCM_BOOL_F) || SCM_EQ_P ((x), SCM_BOOL_T))
/* Convert from a C boolean to a SCM boolean value */
-#define SCM_BOOL(f) ((f) ? SCM_BOOL_T : SCM_BOOL_F)
+#define SCM_BOOL scm_from_bool
/* 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) scm_from_bool(!(f))
/* SCM_BOOL_NOT returns the other boolean.
* The order of ^s here is important for Borland C++ (!?!?!)
@@ -328,6 +334,7 @@ SCM_API SCM scm_gentemp (SCM prefix, SCM obarray);
SCM_API SCM SCM_MAKINUM (scm_t_signed_bits val);
SCM_API int SCM_INUMP (SCM obj);
+#define SCM_NINUMP(x) (!SCM_INUMP(x))
SCM_API scm_t_signed_bits SCM_INUM (SCM obj);
#define SCM_VALIDATE_INUM(pos, k) SCM_MAKE_VALIDATE_MSG (pos, k, INUMP, "exact integer")