summaryrefslogtreecommitdiff
path: root/libguile/expand.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-05-20 12:53:21 +0200
committerAndy Wingo <wingo@pobox.com>2010-05-20 12:53:21 +0200
commit632ddbf02b6983a93a3a8f1268772b78354a335a (patch)
tree3fa0523df57b4f908059dbe1124b297ec74f93c0 /libguile/expand.c
parenta310a1d12e9b44ba77bb28d5491f0bd378a90886 (diff)
downloadguile-632ddbf02b6983a93a3a8f1268772b78354a335a.tar.gz
iron out inconsistency between eval and compile expansion
* libguile/expand.c (expand_lambda_star_case): Harmonize with tree-il, expanding keywords to (aok? (kw name gensym) ...), not (aok? (kw . index) ...). * libguile/memoize.c (memoize): Process the (kw name gensym) format into (kw . index). * module/ice-9/psyntax.scm (build-lambda-case): Remove a compile-versus-eval special case. * module/ice-9/psyntax-pp.scm: Regenerate.
Diffstat (limited to 'libguile/expand.c')
-rw-r--r--libguile/expand.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libguile/expand.c b/libguile/expand.c
index 4b9f0e147..2dd93ecea 100644
--- a/libguile/expand.c
+++ b/libguile/expand.c
@@ -693,7 +693,7 @@ static SCM
expand_lambda_star_case (SCM clause, SCM alternate, SCM env)
{
SCM req, opt, kw, allow_other_keys, rest, formals, vars, body, tmp;
- SCM inits, kw_indices;
+ SCM inits;
int nreq, nopt;
const long length = scm_ilength (clause);
@@ -807,14 +807,12 @@ expand_lambda_star_case (SCM clause, SCM alternate, SCM env)
env = scm_acons (rest, CAR (vars), env);
}
- /* Build up kw inits, env, and kw-indices alist */
+ /* Build up kw inits, env, and kw-canon list */
if (scm_is_null (kw))
kw = SCM_BOOL_F;
else
{
- int idx = nreq + nopt + (scm_is_true (rest) ? 1 : 0);
-
- kw_indices = SCM_EOL;
+ SCM kw_canon = SCM_EOL;
kw = scm_reverse_x (kw, SCM_UNDEFINED);
for (tmp = kw; scm_is_pair (tmp); tmp = scm_cdr (tmp))
{
@@ -842,13 +840,13 @@ expand_lambda_star_case (SCM clause, SCM alternate, SCM env)
else
syntax_error (s_bad_formals, CAR (clause), SCM_UNDEFINED);
- kw_indices = scm_acons (k, SCM_I_MAKINUM (idx++), kw_indices);
inits = scm_cons (expand (init, env), inits);
vars = scm_cons (scm_gensym (SCM_UNDEFINED), vars);
+ kw_canon = scm_cons (scm_list_3 (k, sym, CAR (vars)), kw_canon);
env = scm_acons (sym, CAR (vars), env);
}
- kw_indices = scm_reverse_x (kw_indices, SCM_UNDEFINED);
- kw = scm_cons (allow_other_keys, kw_indices);
+ kw_canon = scm_reverse_x (kw_canon, SCM_UNDEFINED);
+ kw = scm_cons (allow_other_keys, kw_canon);
}
/* We should check for no duplicates, but given that psyntax does this