On Wed, 26 Aug 2009, Michael Zedeler wrote:

Thanks to everyone who has posted their thoughts on Ranges.

Here are the conclusions I have drawn:

Ranges are for checking whether something is within a given interval.
RangeIterators are for iterating over elements in a Range with a given step size using :by.

We discussed using "Series" or "Sequence" in place of RangeIterator, but Series seems too general and Sequence has already been taken.

Up to this point, there are no changes to the spec afaik.


Proposed changes:

It shouldn't be possible to construct RangeIterators over Str (apart from single length strings) or Complex using the Range operator (..).

I haven't been following the conversation, but I've had an idea -- maybe it should be possible to construct a RangeIterator if an ordered set is provided. For example, if the ordered set was '0'.. '9', then the RangeIterator would know that the thing went '0' .. '9', '10' .. '19', '20', etc, whereas if the ordered set was 'a' .. 'z' then it could be something like 'a' .. 'z', 'aa', 'ab' ... 'az', 'ba'...

I realise that maybe the first set should've been '1' .. '0' instead, but the general idea is the thing at the moment.

I wrote all this, and then saw Jon Lang's idea of providing steppers, which is also good.

I think a Complex range only makes sense if you provide 4 endpoints, not 2, but I haven't been following the conversation, so I'll leave it up to the Complex number experts :).

        HTH,


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to