mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
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.
This commit is contained in:
parent
a310a1d12e
commit
632ddbf02b
4 changed files with 8277 additions and 8462 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue