summaryrefslogtreecommitdiff
path: root/libguile/eval.c
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2003-06-04 05:28:34 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2003-06-04 05:28:34 +0000
commitd0624e391be5f644a301e31df9ea54386e2cd7e5 (patch)
treebd5ba87eec78919116d37505e01caa294ce24ef4 /libguile/eval.c
parente90c3a895d37efba2a31995ec85984ec205db974 (diff)
downloadguile-d0624e391be5f644a301e31df9ea54386e2cd7e5.tar.gz
* __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and generalized it to apply not only to C level functions but also to scheme level functions. * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?, scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?, scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p, respectively. * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK): Deprecated. The macro definitions are moved from eval.h into eval.c and a copy is placed into deprecated.h. * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed into eval.c. This definition was not part of the API in any officially released version of guile and thus does not need to go through a phase of deprecation.
Diffstat (limited to 'libguile/eval.c')
-rw-r--r--libguile/eval.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/libguile/eval.c b/libguile/eval.c
index ceaa8e13c..60e82d54d 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -85,6 +85,55 @@ char *alloca ();
+/* {Ilocs}
+ *
+ * Ilocs are memoized references to variables in local environment frames.
+ * They are represented as three values: The relative offset of the
+ * environment frame, the number of the binding within that frame, and a
+ * boolean value indicating whether the binding is the last binding in the
+ * frame.
+ */
+#define SCM_ILOC00 SCM_MAKE_ITAG8(0L, scm_tc8_iloc)
+#define SCM_IDINC (0x00100000L)
+#define SCM_IDSTMSK (-SCM_IDINC)
+#define SCM_MAKE_ILOC(frame_nr, binding_nr, last_p) \
+ SCM_PACK ( \
+ ((frame_nr) << 8) \
+ + ((binding_nr) << 20) \
+ + ((last_p) ? SCM_ICDR : 0) \
+ + scm_tc8_iloc )
+
+#if (SCM_DEBUG_DEBUGGING_SUPPORT == 1)
+
+SCM scm_dbg_make_iloc (SCM frame, SCM binding, SCM cdrp);
+SCM_DEFINE (scm_dbg_make_iloc, "dbg-make-iloc", 3, 0, 0,
+ (SCM frame, SCM binding, SCM cdrp),
+ "Return a new iloc with frame offset @var{frame}, binding\n"
+ "offset @var{binding} and the cdr flag @var{cdrp}.")
+#define FUNC_NAME s_scm_dbg_make_iloc
+{
+ SCM_VALIDATE_INUM (1, frame);
+ SCM_VALIDATE_INUM (2, binding);
+ return SCM_MAKE_ILOC (SCM_INUM (frame),
+ SCM_INUM (binding),
+ !SCM_FALSEP (cdrp));
+}
+#undef FUNC_NAME
+
+SCM scm_dbg_iloc_p (SCM obj);
+SCM_DEFINE (scm_dbg_iloc_p, "dbg-iloc?", 1, 0, 0,
+ (SCM obj),
+ "Return @code{#t} if @var{obj} is an iloc.")
+#define FUNC_NAME s_scm_dbg_iloc_p
+{
+ return SCM_BOOL (SCM_ILOCP (obj));
+}
+#undef FUNC_NAME
+
+#endif
+
+
+
#define SCM_VALIDATE_NON_EMPTY_COMBINATION(x) \
do { \
if (SCM_EQ_P ((x), SCM_EOL)) \