diff options
author | Marius Vollmer <mvo@zagadka.de> | 2001-03-03 15:10:37 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2001-03-03 15:10:37 +0000 |
commit | 5280aacabcc96b4178a8c0b02226fa5665324339 (patch) | |
tree | 4a3ecb25ae07b330dcdcbfa49bd768523f8a9b7d /libguile/eval.h | |
parent | bf4aaed27ca93adc575e9f6f2647ecb4dd3e4f45 (diff) | |
download | guile-5280aacabcc96b4178a8c0b02226fa5665324339.tar.gz |
* eval.h (SCM_EVALIM2): New macro. Use it when a
immediate, literal constant should be evaluated.
* eval.c (scm_s_duplicate_formals): New error message string.
(scm_c_improper_memq): New function.
(scm_m_lambda): Check for duplicate arguments.
(scm_ceval, scm_deval): When executing a body: only cons a new
toplevel environment frame when it is different from the
existing one; use EVALCAR instead of SIDEVAL so that we can properly
check for empty combinations; use SCM_EVALIM2 for the same reason
in the non-toplevel loop.
(nontoplevel_cdrxnoap, nontoplevel_cdrxbegin, nontoplevel_begin):
New labels with the meaning of their non-"nontoplevel" partners,
but they are used when it is known that the body is not evaluated at
top-level.
(scm_apply, scm_dapply): use SCM_EVALIM2 to get proper error
reporting for empty combinations.
Diffstat (limited to 'libguile/eval.h')
-rw-r--r-- | libguile/eval.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libguile/eval.h b/libguile/eval.h index 880cd5d5b..450a7f754 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -97,14 +97,19 @@ extern SCM scm_eval_options_interface (SCM setting); * * For an explanation of symbols containing "EVAL", see beginning of eval.c. */ +#define SCM_EVALIM2(x) (((x) == SCM_EOL) \ + ? scm_wta ((x), scm_s_expression, NULL) \ + : (x)) #ifdef MEMOIZE_LOCALS -#define SCM_EVALIM(x, env) (SCM_ILOCP (x) ? *scm_ilookup ((x), env) : x) +#define SCM_EVALIM(x, env) (SCM_ILOCP (x) \ + ? *scm_ilookup ((x), env) \ + : SCM_EVALIM2(x)) #else -#define SCM_EVALIM(x, env) x +#define SCM_EVALIM(x, env) SCM_EVALIM2(x) #endif #ifdef DEBUG_EXTENSIONS #define SCM_XEVAL(x, env) (SCM_IMP (x) \ - ? (x) \ + ? SCM_EVALIM2(x) \ : (*scm_ceval_ptr) ((x), (env))) #define SCM_XEVALCAR(x, env) (SCM_NCELLP (SCM_CAR (x)) \ ? (SCM_IMP (SCM_CAR (x)) \ @@ -114,7 +119,9 @@ extern SCM scm_eval_options_interface (SCM setting); ? *scm_lookupcar (x, env, 1) \ : (*scm_ceval_ptr) (SCM_CAR (x), env))) #else -#define SCM_XEVAL(x, env) (SCM_IMP (x) ? (x) : scm_ceval ((x), (env))) +#define SCM_XEVAL(x, env) (SCM_IMP (x) \ + ? SCM_EVALIM2(x) \ + : scm_ceval ((x), (env))) #define SCM_XEVALCAR(x, env) EVALCAR (x, env) #endif /* DEBUG_EXTENSIONS */ |