From 715d2ce98414086eba0a04c15dc97c36b60e6979 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 5 Feb 2014 20:34:56 +0900 Subject: [PATCH] More accurate non-strict tests. --- eval.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/eval.c b/eval.c index 1c1109f1..15698ce9 100644 --- a/eval.c +++ b/eval.c @@ -595,13 +595,6 @@ sexp sexp_strip_synclos (sexp ctx, sexp self, sexp_sint_t n, sexp x) { return res; } -#if SEXP_USE_STRICT_TOPLEVEL_BINDINGS -#define sexp_non_local_cell_p(cell) (!cell) -#else -#define sexp_non_local_cell_p(cell) \ - (!cell || (!sexp_lambdap(sexp_cdr(cell)) && !sexp_env_cell_syntactic_p(cell))) -#endif - sexp sexp_identifier_eq_op (sexp ctx, sexp self, sexp_sint_t n, sexp e1, sexp id1, sexp e2, sexp id2) { sexp cell1, cell2; cell1 = sexp_env_cell(ctx, e1, id1, 0); @@ -619,7 +612,13 @@ sexp sexp_identifier_eq_op (sexp ctx, sexp self, sexp_sint_t n, sexp e1, sexp id while (sexp_synclop(id2)) id2 = sexp_synclo_expr(id2); if ((id1 == id2) - && sexp_non_local_cell_p(cell1) && sexp_non_local_cell_p(cell2)) + && ((!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))) +#endif + )) return SEXP_TRUE; return SEXP_FALSE; }