summaryrefslogtreecommitdiff
path: root/libguile/eval.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-05-20 12:25:52 +0200
committerAndy Wingo <wingo@pobox.com>2010-05-20 12:25:52 +0200
commita310a1d12e9b44ba77bb28d5491f0bd378a90886 (patch)
tree37e0581a164c28bd7182ed3bfdff939f71127146 /libguile/eval.c
parent3e5ea35c2fa1bb3d21373723e9a51d213cf79187 (diff)
downloadguile-a310a1d12e9b44ba77bb28d5491f0bd378a90886.tar.gz
primitive-eval takes expanded, not memoized, source
* module/ice-9/eval.scm (primitive-eval): * libguile/eval.c (scm_c_primitive_eval): Don't expect a memoized expression -- expect either raw source or an *expanded* expression. We handle memoization ourselves. * libguile/expand.c (scm_macroexpand): Settle down into its proper name, "macroexpand", even as we comment that it is but a fleeting boot expander. (scm_macroexpanded_p): New predicate for expanded code. * libguile/expand.h: Add scm_macroexpanded_p. * libguile/memoize.c (scm_memoize_expression): Require that the expression be expanded. (scm_init_memoize): Don't alias memoize-expression to macroexpand. * module/ice-9/psyntax-pp.scm: * module/ice-9/psyntax.scm: Always produce macroexpanded expressions, and hand them to primitive-eval. No more calls to memoize-expression here. * test-suite/tests/optargs.test: Remove some tests, as unfortunately we have no way to invoke the boot expander after boot.
Diffstat (limited to 'libguile/eval.c')
-rw-r--r--libguile/eval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libguile/eval.c b/libguile/eval.c
index 63808c62d..752ba2ca5 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -37,6 +37,7 @@
#include "libguile/deprecation.h"
#include "libguile/dynwind.h"
#include "libguile/eq.h"
+#include "libguile/expand.h"
#include "libguile/feature.h"
#include "libguile/fluids.h"
#include "libguile/goops.h"
@@ -832,13 +833,9 @@ scm_for_each (SCM proc, SCM arg1, SCM args)
static SCM
scm_c_primitive_eval (SCM exp)
{
- if (!SCM_MEMOIZED_P (exp))
+ if (!SCM_EXPANDED_P (exp))
exp = scm_call_1 (scm_current_module_transformer (), exp);
- if (!SCM_MEMOIZED_P (exp))
- scm_misc_error ("primitive-eval",
- "expander did not return a memoized expression",
- scm_list_1 (exp));
- return eval (exp, SCM_EOL);
+ return eval (scm_memoize_expression (exp), SCM_EOL);
}
static SCM var_primitive_eval;