diff options
author | Andy Wingo <wingo@pobox.com> | 2013-06-27 12:20:36 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-06-27 22:02:43 +0200 |
commit | 0fcc39a0a962e44d509dbb659529165c7ce5b91d (patch) | |
tree | e47c3cb0809e7857122346e3d3e58f9a6fb3e556 /libguile/memoize.c | |
parent | bc056057c85162b609437e68ec4eb55839682853 (diff) | |
download | guile-0fcc39a0a962e44d509dbb659529165c7ce5b91d.tar.gz |
remove @call-with-values memoizer
* libguile/memoize.h:
* libguile/expand.c (scm_sym_at_call_with_values): Remove.
* libguile/memoize.c (memoize, m_call_values, unmemoize): Adapt to
memoize call-with-values primcalls.
* module/ice-9/boot-9.scm (call-with-values): Expand to a
call-with-values primcall.
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Expect
call-with-values primcall, without the @, and fall back to a normal
call.
* module/language/tree-il/peval.scm (peval): Match bare
call-with-values.
* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*multiply-valued-primitives*): Remove @call-with-values.
Diffstat (limited to 'libguile/memoize.c')
-rw-r--r-- | libguile/memoize.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/libguile/memoize.c b/libguile/memoize.c index 2975f5686..2cad1bb10 100644 --- a/libguile/memoize.c +++ b/libguile/memoize.c @@ -287,6 +287,10 @@ memoize (SCM exp, SCM env) scm_from_latin1_symbol ("call-with-current-continuation"))) return MAKMEMO_CONT (CAR (args)); + else if (nargs == 2 + && scm_is_eq (name, + scm_from_latin1_symbol ("call-with-values"))) + return MAKMEMO_CALL_WITH_VALUES (CAR (args), CADR (args)); else if (scm_is_eq (scm_current_module (), scm_the_root_module ())) return MAKMEMO_CALL (MAKMEMO_TOP_REF (name), nargs, args); else @@ -532,24 +536,13 @@ SCM_DEFINE (scm_memoize_expression, "memoize-expression", 1, 0, 0, #define SCM_DEFINE_MEMOIZER(STR, MEMOIZER, N) \ SCM_SNARF_INIT(scm_c_define (STR, SCM_MAKE_MEMOIZER (STR, MEMOIZER, N))) -static SCM m_call_values (SCM prod, SCM cons); static SCM m_dynamic_wind (SCM pre, SCM exp, SCM post); -SCM_DEFINE_MEMOIZER ("@call-with-values", m_call_values, 2); SCM_DEFINE_MEMOIZER ("@dynamic-wind", m_dynamic_wind, 3); -static SCM m_call_values (SCM prod, SCM cons) -#define FUNC_NAME "@call-with-values" -{ - SCM_VALIDATE_MEMOIZED (1, prod); - SCM_VALIDATE_MEMOIZED (2, cons); - return MAKMEMO_CALL_WITH_VALUES (prod, cons); -} -#undef FUNC_NAME - static SCM m_dynamic_wind (SCM in, SCM expr, SCM out) #define FUNC_NAME "memoize-dynwind" { @@ -633,7 +626,7 @@ unmemoize (const SCM expr) ("call-with-current_continuation"), unmemoize (args)); case SCM_M_CALL_WITH_VALUES: - return scm_list_3 (scm_sym_at_call_with_values, + return scm_list_3 (scm_from_latin1_symbol ("call-with-values"), unmemoize (CAR (args)), unmemoize (CDR (args))); case SCM_M_DEFINE: return scm_list_3 (scm_sym_define, CAR (args), unmemoize (CDR (args))); |