diff options
author | Andy Wingo <wingo@pobox.com> | 2010-06-17 10:49:00 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-06-17 13:43:26 +0200 |
commit | fb6e61ca21b397308474a6a553f7d502d0113251 (patch) | |
tree | 356949850d0d0e7a6f822140e5463704566fbc34 /libguile/expand.c | |
parent | f238862e9ec7c69d69eb3941f14844501c0f5937 (diff) | |
download | guile-fb6e61ca21b397308474a6a553f7d502d0113251.tar.gz |
beginnings of letrec* support in the expander
* libguile/expand.h (SCM_EXPANDED_LETREC_IN_ORDER_P)
(SCM_MAKE_EXPANDED_LETREC): Add a new field to letrec, in-order?. Will
be used to support letrec*.
* libguile/expand.c (LETREC, expand_named_let, expand_letrec): Adapt
code.
* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/ice-9/psyntax.scm (build-named-let, build-letrec): Pass #f for
in-order? to `make-letrec'.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/language/tree-il.scm: Add letrec-in-order? accessor.
(parse-tree-il, unparse-tree-il): Parse and unparse an in-order?
letrec as `letrec*'.
(tree-il->scheme): Serialize letrec*.
Diffstat (limited to 'libguile/expand.c')
-rw-r--r-- | libguile/expand.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libguile/expand.c b/libguile/expand.c index 2dd93ecea..62e3acfb6 100644 --- a/libguile/expand.c +++ b/libguile/expand.c @@ -81,8 +81,8 @@ static const char** exp_field_names[SCM_NUM_EXPANDED_TYPES]; SCM_MAKE_EXPANDED_LAMBDA_CASE(src, req, opt, rest, kw, inits, gensyms, body, alternate) #define LET(src, names, gensyms, vals, body) \ SCM_MAKE_EXPANDED_LET(src, names, gensyms, vals, body) -#define LETREC(src, names, gensyms, vals, body) \ - SCM_MAKE_EXPANDED_LETREC(src, names, gensyms, vals, body) +#define LETREC(src, in_order_p, names, gensyms, vals, body) \ + SCM_MAKE_EXPANDED_LETREC(src, in_order_p, names, gensyms, vals, body) #define DYNLET(src, fluids, vals, body) \ SCM_MAKE_EXPANDED_DYNLET(src, fluids, vals, body) @@ -984,7 +984,7 @@ expand_named_let (const SCM expr, SCM env) inner_env = expand_env_extend (inner_env, var_names, var_syms); return LETREC - (scm_source_properties (expr), + (scm_source_properties (expr), SCM_BOOL_F, scm_list_1 (name), scm_list_1 (name_sym), scm_list_1 (LAMBDA (SCM_BOOL_F, SCM_EOL, @@ -1048,7 +1048,7 @@ expand_letrec (SCM expr, SCM env) SCM var_names, var_syms, inits; transform_bindings (bindings, expr, &var_names, &var_syms, &inits); env = expand_env_extend (env, var_names, var_syms); - return LETREC (SCM_BOOL_F, + return LETREC (SCM_BOOL_F, SCM_BOOL_F, var_names, var_syms, expand_exprs (inits, env), expand_sequence (CDDR (expr), env)); } |