macro expanders return memoized expressions
authorAndy Wingo <wingo@pobox.com>
Fri, 7 May 2010 08:51:28 +0000 (10:51 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 7 May 2010 20:22:19 +0000 (22:22 +0200)
commit4f692ace90f2dc75b83aa9e10d9cd107d2ea924e
treef01b7c934fe781a95ac5d95f8257d78db35b8e11
parentb79ba0b01e7dc89d2ba8da2c5cf4e200f4bb5de1
macro expanders return memoized expressions

* libguile/eval.c (scm_c_primitive_eval):
* module/ice-9/eval.scm (primitive-eval): Rely on the expander to
  produce a memoized expression. If the expression is already memoized,
  just pass it through (the equivalent of the old "noexpand" hack).

* libguile/memoize.c (scm_init_memoize): Initialize `memoize-expression'
  as the initial binding of `macroexpand'.

* libguile/modules.c (scm_module_transformer): Before modules are
  booted, look for `macroexpand', not `%pre-modules-transformer'.

* module/ice-9/boot-9.scm: No more %pre-modules-transformer. Loading
  psyntax extends `macroexpand'.
  (make-module): `macroexpand' is the default transformer.

* module/ice-9/psyntax.scm: No more `noexpand'.
  (top-level-eval-hook, local-eval-hook): Instead of annotating with
  noexpand, memoize the expression before handing it to primitive-eval.
  (macroexpand): No more noexpand hack -- in its place we have another
  hack, to memoize the result when running in eval mode.
* module/ice-9/psyntax-pp.scm: Regenerated.
libguile/eval.c
libguile/memoize.c
libguile/modules.c
module/ice-9/boot-9.scm
module/ice-9/eval.scm
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm