primitive support for lambda*
authorAndy Wingo <wingo@pobox.com>
Thu, 13 May 2010 15:15:10 +0000 (17:15 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 13 May 2010 22:28:32 +0000 (00:28 +0200)
commitd8a071fc4e709ee83cd3c7fc935f7ec21375e624
tree50cfb2eca1aa4d7b275c992862d9a677471a588c
parent9658182d5f51368e2888cb461edfc2f35f91c6ac
primitive support for lambda*

* libguile/memoize.c (scm_m_lambda_star): Define lambda* in the
  pre-psyntax env, and make it memoize lambda* expressions.

* libguile/eval.c (BOOT_CLOSURE_PARSE_FULL): New helper.
  (error_invalid_keyword, error_unrecognized_keyword): New helpers.
  (prepare_boot_closure_env_for_apply): Flesh out application of boot
  closures with "full" arity.
  (prepare_boot_closure_env_for_eval): Punt to
  prepare_boot_closure_env_for_eval for the full-arity case.

* module/ice-9/eval.scm (make-fixed-closure): Rename from `closure', and
  just handle fixed arities, where there is no rest argument..
  (make-general-closure): New helper, a procedure, that returns a
  closure that can take rest, optional, and keyword arguments.
  (eval): Adapt to call make-fixed-closure or make-general-closure as
  appropriate.

* test-suite/tests/optargs.test ("lambda* inits"): Test the memoizer as
  well.
libguile/eval.c
libguile/memoize.c
module/ice-9/eval.scm
test-suite/tests/optargs.test