summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-06-30 22:14:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-06-30 22:14:49 -0700
commit39772cff9b5872bca9d8760d704083e563348f54 (patch)
tree7e0d509ddd9938f924ee1fa935e2d4e789e99642 /lib.c
parent349c01fff273ffcaf5d46873121a067eb82f7997 (diff)
downloadtxr-39772cff9b5872bca9d8760d704083e563348f54.tar.gz
txr-39772cff9b5872bca9d8760d704083e563348f54.tar.bz2
txr-39772cff9b5872bca9d8760d704083e563348f54.zip
Bug: ranges not treated as iterable in some situations.
* lib.c (seq_kind_tab): Map the RNG type to SEQ_VECLIKE rather than SEQ_NOTSEQ. This one liner change causes ranges to be rejected for iteration needlessly. For instance, we can now do (take 42 "00".."99"). Note that ranges are not literally vector-like; they don't support the ref operation. The effect of this change is simply that they are not rejected due to being SEQ_NOTSEQ. The iteration code already handles RNG specially, so the SEQ_VECLIKE classification doesn't actually matter.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 44f5005f..ec62119c 100644
--- a/lib.c
+++ b/lib.c
@@ -169,7 +169,7 @@ const seq_kind_t seq_kind_tab[MAXTYPE+1] = {
SEQ_NOTSEQ, /* CPTR */
SEQ_NOTSEQ, /* ENV */
SEQ_NOTSEQ, /* BGNUM */
- SEQ_NOTSEQ, /* RNG */
+ SEQ_VECLIKE, /* RNG */
SEQ_VECLIKE, /* BUF */
SEQ_NOTSEQ, /* TNOD */
SEQ_NOTSEQ, /* DARG */