| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* lib.c (iter_begin, iter_more, iter_item, iter_step,
iter_reset, copy_iter): Handle FLNUM like NUM, so that we
don't wastefully return a dynamic iterator object.
* tests/012/iter.tl: Test cases for numeric and character
iteration. Test cases for iter-begin on some basic types.
copy-iter test for floats.
|
|
|
|
|
| |
* tests/012/iter.tl: Test copy-iter for lists, vectors,
integers, characters, strings, string ranges, numeric ranges.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we get rid of the wrongheaded notion that a
string range, as such, is ascending or descending. In fact,
the corresponding character positions are individually
ascending or descending.
* lib.c (seq_iter_get_range_str): Either increment or
decrement the character in the step string depending on
whether that position is in order or reversed.
(seq_iter_get_rev_range_str): Static function removed.
(si_rev_range_str_ops): Static structure removed.
(seq_iter_init_with_info): For string ranges, use
si_range_str_ops regardless of the strings being
lexicographically reversed.
* test/012/iter.tl: New test case.
* txr.1: Redocumented string ranges.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register iter-cat intrinsic.
* lib.h (struct seq_iter): New union member dargs.
(iter_catv): Declared.
* lib.c (seq_iter_get_cat, seq_iter_peek_cat): New
static functions.
(si_cat_ops): New static structure.
(iter_catv): New function.
* tests/012/iter.tl: New tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (do_generic_funcall): Allow integers and ranges
to be function callable. They take one argument and
index into it or extract a slice. In the case of ranges,
this is a breaking change. Ranges can already be used
in the function position in some limited ways that are
not worth preserving.
* tests/012/callable.tl: New file.
* tests/012/iter.tl: Here we fix two instances of
breakage. Using txr -C 288 will restore the
behaviors previously tested here.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (seq_iter_get_range_bignum): Static function
renamed to seq_iter_get_range_number because it
in fact generalizes to numbers.
(seq_iter_peek_range_bignum): Renamed to
seq_iter_peek_range_number.
(seq_iter_get_rev_range_bignum): Renamed to
seq_iter_get_rev_range_number.
(seq_iter_peek_rev_range_bignum): Renamed to
seq_iter_peek_rev_range_number.
(si_range_bignum_ops): Renamed to si_range_number_ops.
(si_rev_range_bignum_ops): Renamed to
si_rev_range_number_ops.
(seq_iter_init_with_info): Handle ranges where
the from value is floating-point.
Also, if the from-value is bignum that fits into
cnum range, we now try to handle that as a cnum
range.
* tests/012/iter.tl: New tests.
|
|
|
|
|
| |
* tests/012/iter.tl: Several new cases to provide some
coverage in recently fixed areas. All of these break in 268.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we allow the s in (sub s from to) and [s from..to]
to be any iterable.
* lib.c (iter_dynamic, sub_iter): New static function.
(generic_funcall): Handle all objects via the sequence case:
ref, sub and all that. Unfortunately, we lose some error
handling at the level of the sub function. But we allow any
iterable to be passed through to sub.
(sub): Handle default case through sub_iter.
* tests/012/iter.tl: New cases.
* txr.1: Documented.
|
|
Ranges like "AAA".."ZZZ" are now possible.
* lib.c (seq_iter_get_range_str, seq_iter_peek_range_str,
seq_iter_get_rev_range_str): New static functions.
(seq_iter_init_with_info): Support string ranges via above
new functions. Range direction test is now done with less
and equal rather than lt and gt.
* tests/012/iter.tl: New file.
* txr.1: Documented.
|