diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-11 23:33:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-11 23:33:49 -0700 |
commit | 556dd7362f7a7ccb946c87b88e0685e606c7a9a6 (patch) | |
tree | 5be2830e50d79ec1a4f95e5715909b4c6169c3df /chksums/sha256.h | |
parent | 00e87d26df9f2cd0580b48f92db8ea93a845fbf7 (diff) | |
download | txr-556dd7362f7a7ccb946c87b88e0685e606c7a9a6.tar.gz txr-556dd7362f7a7ccb946c87b88e0685e606c7a9a6.tar.bz2 txr-556dd7362f7a7ccb946c87b88e0685e606c7a9a6.zip |
tree: streamline iteration; provide high limit.
Getting rid of tree-begin-at and tree-reset-at. Now tree-begin
takes two optional parameters, for specifying high and low
range.
* tree.c (struct tree_diter): New members, tree and highkey.
We need tree due to requiring access to the less function.
If the iterator has no highkey, the iterator itself is stored
in that member to indicate this.
(tree_iter_mark): Mark the tree and highkey.
(tree_begin): Take optional lowkey and highkey arguments,
initializing iterator acordingly.
(tree_begin_at): Function removed.
(copy_tree_iter, replace_tree_iter): Copy tree and highkey
members. The latter require special handling due to the funny
convention for indicating highkey absence.
(tree_reset): Take optional lowkey and highkey arguments,
configuring these in the iterator being reset.
(tree_reset_at): Function removed.
(tree_next, tree_peek): Implement highkey semantics.
(sub_tree): Simplified: from and to
arguments are just passed through to tree_begin, and there is
no need for a separate loop which enforces the upper limit,
that now being handled by the iterator itself.
(tree_begin): Update registrations of tree-begin and
tree-reset; remove tree-begin-at and tree-reset-at intrinsics.
* tree.h (tree_begin_at, tree_reset_at): Declarations removed.
(tree_begin, tree_reset): Declarations updated.
* lib.c (seq_iter_rewind, seq_iter_init_with_info, where,
populate_obj_hash): Default new optional arguments in
tree_begin and tree_reset calls.
* parser.c (circ_backpatch): Likewise.
* tests/010/tree.tl: Affected cases updated.
* txr.1: Documentation updated.
* share/txr/stdlib/doc-syms.tl: Regenerated.
Diffstat (limited to 'chksums/sha256.h')
0 files changed, 0 insertions, 0 deletions