Do infinite bidirectional ranges make any sense?

deadalnix deadalnix at gmail.com
Mon Aug 13 16:57:17 PDT 2012


Le 12/08/2012 15:28, Andrei Alexandrescu a écrit :
> 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

I do see the lack of actual practical use case, (it doesn't mean none 
exists, but few exists) but what does excluding that case brings us ?


More information about the Digitalmars-d mailing list