From e6f1010ef967123bcc1046383d228dbae78bcde4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 7 Jun 2021 06:29:07 -0700 Subject: expander: expand must only ignores unbound warnings. The expand function must not muffle all deferred warnings. That causes the problem that a form like (inc var a.bar) fails to produce a warning due to bar not being the slot of any structure. The expand function must only muffle warnings about undefined functions and variables. * eval.c (muffle_unbound_warning): New static function. (no_warn_expand): Use muffle_unbound_warning as handler, rather than uw_muffle_warning. * tests/012/struct.tl: Fix two test cases here which test the expand function using a form that references a nonexistent slot. These now generate a warning, so we use the slot name b rather than d, which is defined. * txr.1: Documented change to expand. --- tests/012/struct.tl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/012/struct.tl') diff --git a/tests/012/struct.tl b/tests/012/struct.tl index 57234913..3f03552d 100644 --- a/tests/012/struct.tl +++ b/tests/012/struct.tl @@ -43,10 +43,10 @@ (stest (ignwarn (expand 's.(a b c))) "(call (slot s 'a)\n \ \ s b c)") -(test (expand 's.[a].d) - (slot [(slot s 'a) s] 'd)) -(test (expand 's.[a b c].d) - (slot [(slot s 'a) s b c] 'd)) +(test (expand 's.[a].b) + (slot [(slot s 'a) s] 'b)) +(test (expand 's.[a b c].b) + (slot [(slot s 'a) s b c] 'b)) (set *gensym-counter* 0) (stest (ignwarn (expand 's.(a).d)) "(slot (call (slot s 'a)\n \ -- cgit v1.2.3