mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
* 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.
This commit is contained in:
parent
bf4aaed27c
commit
5280aacabc
2 changed files with 73 additions and 31 deletions
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue