From e1841e6982a68ec90fc7c80901a98a66f21318b3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 24 Nov 2011 22:43:52 -0800 Subject: * lib.c (getplist_f): New function. * lib.h (getplist_f): Declared. * match.c (v_collect, h_coll): Use getplist_f to distinguish the case that :vars is explicitly specified as (). In this case, no bindings escape from the collect. * tests/008/soundex.txr: This test case broke due to using :vars () and yet counting on the variable to exist. * RELNOTES: Updated. --- lib.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 1076bb2c..440b258e 100644 --- a/lib.c +++ b/lib.c @@ -677,6 +677,20 @@ val getplist(val list, val key) return nil; } +val getplist_f(val list, val key, val *found) +{ + for (; list; list = cdr(cdr(list))) { + val ind = first(list); + if (eq(ind, key)) { + *found = t; + return second(list); + } + } + + *found = nil; + return nil; +} + val proper_plist_to_alist(val list) { list_collect_decl (out, tail); -- cgit v1.2.3