Do infinite bidirectional ranges make any sense?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Aug 12 06:28:46 PDT 2012


On 8/12/12 9:11 AM, Simen Kjaeraas wrote:
> On Sun, 12 Aug 2012 06:11:48 +0200, Jonathan M Davis
> <jmdavisProg at gmx.com> wrote:
>
>> Can anyone think of any situation where an infinite bidirectional
>> range would make any sense at all?
>
> std.range.repeat(1);
>
> I would be very surprised if that's not both bidirectional and infinite.

Nice. I'm sure there are mathematically-motivated bidirectional infinite 
ranges that are more interesting than the constant range. However, I 
think few, if any, would be of practical interest. We could and should 
probably proceed with the simplification that any bidirectional range 
must be finite.

Andrei


More information about the Digitalmars-d mailing list