From 39772cff9b5872bca9d8760d704083e563348f54 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 30 Jun 2023 22:14:49 -0700 Subject: 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. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- cgit v1.2.3