mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
Non-strict top-level identifier matching now works if the identifier
is bound in only one of the environments. This is necessary in the case where a library uses an unbound keyword (e.g. "with" in (chibi loop)), but you want to use it along with a binding for the keyword (e.g. "with" in (chibi show)). The alternative to work with the current logic is to always require such keywords to be bound, in this case to add a dummy "with" auxiliary syntax binding to (chibi loop), however this doesn't seem any safer than the new logic, and the whole point of the feature is convenience. Fixes issue #221.
This commit is contained in:
parent
82bc3b931f
commit
2e481d57e9
1 changed files with 4 additions and 3 deletions
7
eval.c
7
eval.c
|
@ -619,9 +619,10 @@ sexp sexp_identifier_eq_op (sexp ctx, sexp self, sexp_sint_t n, sexp e1, sexp id
|
|||
if ((id1 == id2)
|
||||
&& ((!cell1 && !cell2)
|
||||
#if !SEXP_USE_STRICT_TOPLEVEL_BINDINGS
|
||||
|| ((cell1 && cell2)
|
||||
&& (!sexp_lambdap(sexp_cdr(cell1)) && !sexp_env_cell_syntactic_p(cell1))
|
||||
&& (!sexp_lambdap(sexp_cdr(cell2)) && !sexp_env_cell_syntactic_p(cell2)))
|
||||
|| ((!cell1 || (!sexp_lambdap(sexp_cdr(cell1)) &&
|
||||
!sexp_env_cell_syntactic_p(cell1))) &&
|
||||
(!cell2 || (!sexp_lambdap(sexp_cdr(cell2)) &&
|
||||
!sexp_env_cell_syntactic_p(cell2))))
|
||||
#endif
|
||||
))
|
||||
return SEXP_TRUE;
|
||||
|
|
Loading…
Add table
Reference in a new issue