summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-02 06:13:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-02 06:13:00 -0700
commitdcd0c4e0485ad5f8cf571bffa99add57c8aed183 (patch)
treecd17a850e3434b749a7366adf9668cd5e1a11fe9 /share
parent7d6e2b419916c915543e36f14891773294687b99 (diff)
downloadtxr-dcd0c4e0485ad5f8cf571bffa99add57c8aed183.tar.gz
txr-dcd0c4e0485ad5f8cf571bffa99add57c8aed183.tar.bz2
txr-dcd0c4e0485ad5f8cf571bffa99add57c8aed183.zip
New style iteration functions.
iter-begin provides a paradigm for iteration that is more compatible with lists. If the sequence is a list, then the list itself is returned as the iterator, and the other functions are basicaly wrappers for car/cdr and null testing. Yet the API is defined in such a way that other objects can be iterated with good efficiency, at the cost of allocating a new iterator object (which can be re-used). * eval.c (eval_init): Register iter-begin, iter-more, iter-item, iter-step and iter-reset. * lib.c (seq_iter_init_with_info): New static function. (seq_iter_init): Now a thin wrapper for seq_iter_init_with_info. (iter_begin, iter_more, iter_item, iter_step, iter_reset): New functions. * lib.h (iter_begin, iter_more, iter_item, iter_step, iter_reset): New functions. * txr.1: Documented.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions