diff options
author | Andy Wingo <wingo@pobox.com> | 2014-12-07 15:52:34 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-12-07 15:52:34 +0100 |
commit | e6a42e676528bf56c6535a7e0c79e936a6d2a818 (patch) | |
tree | 82802288051ec1941785bd49bbbbac18e57db6c1 /libguile/expand.c | |
parent | a3cae847d0e6c77494c7cf5f395e8234e3b9b5cf (diff) | |
download | guile-e6a42e676528bf56c6535a7e0c79e936a6d2a818.tar.gz |
Simplify variable resolution in the evaluator
* libguile/expand.c (convert_assignment): Handle creation of the default
lambda-case body here.
* libguile/eval.c (eval):
* module/ice-9/eval.scm (primitive-eval):
* libguile/memoize.h:
* libguile/memoize.c (MAKMEMO_BOX_REF, MAKMEMO_BOX_SET):
(MAKMEMO_TOP_BOX, MAKMEMO_MOD_BOX): Refactor all global var resolution
to go through "resolve". Add "box-ref" and "box-set!". Rename
memoize-variable-access! to %resolve-variable, and don't be
destructive.
Diffstat (limited to 'libguile/expand.c')
-rw-r--r-- | libguile/expand.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libguile/expand.c b/libguile/expand.c index e1c6c18a5..91097c2d5 100644 --- a/libguile/expand.c +++ b/libguile/expand.c @@ -1412,7 +1412,21 @@ convert_assignment (SCM exp, SCM assigned) return LAMBDA (REF (exp, LAMBDA, SRC), REF (exp, LAMBDA, META), - convert_assignment (REF (exp, LAMBDA, BODY), assigned)); + scm_is_false (REF (exp, LAMBDA, BODY)) + /* Give a body to case-lambda with no clauses. */ + ? LAMBDA_CASE (SCM_BOOL_F, SCM_EOL, SCM_EOL, SCM_BOOL_F, SCM_BOOL_F, + SCM_EOL, SCM_EOL, + PRIMCALL + (SCM_BOOL_F, + scm_from_latin1_symbol ("throw"), + scm_list_5 (CONST_ (SCM_BOOL_F, scm_args_number_key), + CONST_ (SCM_BOOL_F, SCM_BOOL_F), + CONST_ (SCM_BOOL_F, scm_from_latin1_string + ("Wrong number of arguments")), + CONST_ (SCM_BOOL_F, SCM_EOL), + CONST_ (SCM_BOOL_F, SCM_BOOL_F))), + SCM_BOOL_F) + : convert_assignment (REF (exp, LAMBDA, BODY), assigned)); case SCM_EXPANDED_LAMBDA_CASE: { |