summaryrefslogtreecommitdiffstats
path: root/tests/012/iter.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-06-20 01:38:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-06-20 01:38:57 -0700
commitc3c1490109c3600e2e8e63f24ebe3021b23b96dc (patch)
tree313b472c25866bb1a696793eddb2278578cef87f /tests/012/iter.tl
parent19456350b81fcc95d09468989c34a20fb1ad9bc9 (diff)
downloadtxr-c3c1490109c3600e2e8e63f24ebe3021b23b96dc.tar.gz
txr-c3c1490109c3600e2e8e63f24ebe3021b23b96dc.tar.bz2
txr-c3c1490109c3600e2e8e63f24ebe3021b23b96dc.zip
string ranges: individual positions are ascending/descending.
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.
Diffstat (limited to 'tests/012/iter.tl')
-rw-r--r--tests/012/iter.tl4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/012/iter.tl b/tests/012/iter.tl
index 0823849e..96bcabbd 100644
--- a/tests/012/iter.tl
+++ b/tests/012/iter.tl
@@ -58,6 +58,10 @@
"F06" "F07" "F08" "F09" "F10"))
(test
+ (list-seq "AC".."CA")
+ ("AC" "AB" "AA" "BC" "BB" "BA" "CC" "CB" "CA"))
+
+(test
[mapcar identity [3..6 0..10]] (3 4 5))
;; iterating from fixnum to bignum was rejected in up to txr-269.