summaryrefslogtreecommitdiff
path: root/libguile/debug.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-01-03 04:02:08 -0500
committerAndy Wingo <wingo@pobox.com>2012-01-26 12:08:58 +0100
commitd062a8c1eeeb55264c1a2fd8f4fbe765f1dcc6d9 (patch)
tree6f6ff45825aa6bf97fa5b7f5db125e97227bee15 /libguile/debug.c
parentf5e772b2bac149c854b9b003e7a96632af7f8760 (diff)
downloadguile-d062a8c1eeeb55264c1a2fd8f4fbe765f1dcc6d9.tar.gz
Implement `local-eval', `local-compile', and `the-environment'
* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which exports `the-environment', `local-eval', and `local-compile'. * libguile/debug.c (scm_local_eval): New C function that calls the Scheme implementation of `local-eval' in (ice-9 local-eval). * libguile/debug.h (scm_local_eval): Add prototype. * doc/ref/api-evaluation.texi (Local Evaluation): Add documentation. * test-suite/tests/eval.test (local evaluation): Add tests. * test-suite/standalone/test-loose-ends.c (test_scm_local_eval): Add test. * module/Makefile.am: Add ice-9/local-eval.scm. Based on a patch by Mark H Weaver <mhw@netris.org>.
Diffstat (limited to 'libguile/debug.c')
-rw-r--r--libguile/debug.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libguile/debug.c b/libguile/debug.c
index 88a01d6aa..b1a90d84d 100644
--- a/libguile/debug.c
+++ b/libguile/debug.c
@@ -1,5 +1,5 @@
/* Debugging extensions for Guile
- * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011 Free Software Foundation
+ * Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011, 2012 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -208,6 +208,17 @@ SCM_DEFINE (scm_debug_hang, "debug-hang", 0, 1, 0,
#undef FUNC_NAME
#endif
+SCM
+scm_local_eval (SCM exp, SCM env)
+{
+ static SCM local_eval_var = SCM_BOOL_F;
+
+ if (scm_is_false (local_eval_var))
+ local_eval_var = scm_c_public_variable ("ice-9 local-eval", "local-eval");
+
+ return scm_call_2 (SCM_VARIABLE_REF (local_eval_var), exp, env);
+}
+
static void
init_stack_limit (void)
{