summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-28 07:17:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-28 07:17:12 -0700
commitdc7842296466eba508f791ef1f9a9c3b16f7d4da (patch)
treef64003ee37f12b7baa77a284154b2c7f691f9943 /lib.c
parent64fb78f1b28fa435f97dbf5fda1c574338063083 (diff)
downloadtxr-dc7842296466eba508f791ef1f9a9c3b16f7d4da.tar.gz
txr-dc7842296466eba508f791ef1f9a9c3b16f7d4da.tar.bz2
txr-dc7842296466eba508f791ef1f9a9c3b16f7d4da.zip
seq-begin: bugfix: non-lists don't work.
* lib.c (seq_begin): Do not null out si->inf.obj; it's needed for accessing hashes and vector-like objects. This bug means that seq-begin iteration has only worked correctly for lists. The original motivation was not to have spurious retention of the head of a lazy list, which is hereby reintroduced. But iterators can be rewound. Let's just document this away and leave it as a to-do item. * txr.1: Document the limitation of seq-begin w.r.t. lazy lists.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 40662d29..522128a6 100644
--- a/lib.c
+++ b/lib.c
@@ -454,7 +454,6 @@ val seq_begin(val obj)
struct seq_iter *si = coerce(struct seq_iter *, chk_calloc(1, sizeof *si));
si_obj = cobj(coerce(mem_t *, si), seq_iter_s, &seq_iter_ops);
seq_iter_init(self, si, obj);
- si->inf.obj = nil;
return si_obj;
}