From 722a6ca9a69cdd0a463d48af5380af19fd9779fc Mon Sep 17 00:00:00 2001
From: Kaz Kylheku <kaz@kylheku.com>
Date: Wed, 12 May 2021 06:21:58 -0700
Subject: tree: let tree-iter be iterable via generic iteration.

* lib.c (seq_iter_init_with_info): Recognize tree_iter object,
and treat using tree iterator function.

* tests/010/tree.tl: test case for tree subrange iteration
with collect-each.

* txr.1: Updated.
---
 tests/010/tree.tl | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'tests/010/tree.tl')

diff --git a/tests/010/tree.tl b/tests/010/tree.tl
index b41e7973..06d02ce6 100644
--- a/tests/010/tree.tl
+++ b/tests/010/tree.tl
@@ -166,6 +166,11 @@
     (copy-search-tree tr) #T((identity < =) 1 2 3)
     (make-similar-tree tr) #T((identity < =))))
 
+(test
+  (collect-each ((el (tree-begin #T(() 1 2 3 4 5) 2 5)))
+    (* 10 el))
+  (20 30 40))
+
 (mtest
   (uni #T(() "a" "b") #T(() "b" "c")) ("a" "b" "c")
   (diff #T(() "a" "b") #T(() "b" "c")) ("a")
-- 
cgit v1.2.3