1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

memoize (begin foo) to foo

* libguile/memoize.c (memoize_sequence): Don't make a `begin' if there's
  only one form.
This commit is contained in:
Andy Wingo 2010-02-18 12:28:37 +01:00
parent 21ec0bd907
commit b5e9f3f97e

View file

@ -378,7 +378,10 @@ memoize_sequence (const SCM forms, const SCM env)
{
ASSERT_SYNTAX (scm_ilength (forms) >= 1, s_bad_expression,
scm_cons (scm_sym_begin, forms));
return MAKMEMO_BEGIN (memoize_exprs (forms, env));
if (scm_is_null (CDR (forms)))
return memoize (CAR (forms), env);
else
return MAKMEMO_BEGIN (memoize_exprs (forms, env));
}