From 4aac1a2a6144d04a047966e295727258bd09a734 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 30 Jun 2014 06:30:30 -0700 Subject: * lib.c (sel): Bugfix: not implemented correctly for sequences which are lists. --- ChangeLog | 5 +++++ lib.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a41dccd0..87b2ca08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-06-30 Kaz Kylheku + + * lib.c (sel): Bugfix: not implemented correctly for sequences + which are lists. + 2014-06-28 Kaz Kylheku * arith.c (bit): New function. diff --git a/lib.c b/lib.c index 8a6f9ed2..e45902c1 100644 --- a/lib.c +++ b/lib.c @@ -5576,10 +5576,8 @@ val sel(val seq_in, val where_in) for (; seq && where; seq = cdr(seq), idx = plus(idx, one)) { val wh; - do { - wh = car(where); - where = cdr(where); - } while (lt(wh, idx)); + for (; where && lt(wh = car(where), idx); where = cdr(where)) + ; /* empty */ if (eql(wh, idx)) ptail = list_collect (ptail, car(seq)); -- cgit v1.2.3