From 2e481d57e92948c715e1e87a6ad0785045f07305 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sat, 25 Apr 2015 10:56:58 +0900 Subject: [PATCH] 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. --- eval.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eval.c b/eval.c index d195eb6c..a074715b 100644 --- a/eval.c +++ b/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;