mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
make out-of-order define warning less zealous for begin/include
Fixes issue #312.
This commit is contained in:
parent
f66797ecdf
commit
255b167597
1 changed files with 9 additions and 1 deletions
10
eval.c
10
eval.c
|
@ -642,6 +642,14 @@ sexp sexp_identifier_eq_op (sexp ctx, sexp self, sexp_sint_t n, sexp e1, sexp id
|
|||
|
||||
/************************* the compiler ***************************/
|
||||
|
||||
static int lambda_envp(sexp ctx) {
|
||||
sexp env;
|
||||
for (env=sexp_context_env(ctx); env && sexp_envp(env); env=sexp_env_parent(env))
|
||||
if (sexp_env_lambda(env))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nondefp(sexp x) {
|
||||
sexp ls;
|
||||
if (sexp_pairp(x) || sexp_cndp(x))
|
||||
|
@ -663,7 +671,7 @@ static sexp analyze_list (sexp ctx, sexp x, int depth, int defok) {
|
|||
res = tmp;
|
||||
break;
|
||||
} else {
|
||||
if (nondefp(tmp)) defok = -1; /* -1 to warn */
|
||||
if (lambda_envp(ctx) && nondefp(tmp)) defok = -1; /* -1 to warn */
|
||||
sexp_pair_source(res) = sexp_pair_source(x);
|
||||
sexp_car(res) = tmp;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue