Re: Do infinite bidirectional ranges make any sense?

2012-08-13 Thread Jonathan M Davis
On Tuesday, August 14, 2012 01:57:17 deadalnix wrote: > 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 ? I don't know if it's useful one way or the other as far as making it illegal goes, but it's certain

Re: Do infinite bidirectional ranges make any sense?

2012-08-13 Thread deadalnix
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 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

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread Timon Gehr
On 08/12/2012 06:01 PM, Joseph Rushton Wakeling wrote: On 12/08/12 05:11, Jonathan M Davis wrote: Can anyone think of any situation where an infinite bidirectional range would make any sense at all? Surely in principle, any countable set? Albeit that in practice some of them might not be conve

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread Andrej Mitrovic
On 8/12/12, Jonathan M Davis wrote: > Can anyone think of any situation where an infinite bidirectional range > would > make any sense at all? Cyclic buffers? At least in audio it's common to play buffer samples in a loop and even play them in reverse. I'd imagine internally C/++ apps just have a

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread Joseph Rushton Wakeling
On 12/08/12 05:11, Jonathan M Davis wrote: Can anyone think of any situation where an infinite bidirectional range would make any sense at all? Surely in principle, any countable set? Albeit that in practice some of them might not be convenient to represent that way. Does "infinite bidirect

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread Andrei Alexandrescu
On 8/12/12 9:11 AM, Simen Kjaeraas wrote: On Sun, 12 Aug 2012 06:11:48 +0200, Jonathan M Davis 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 infi

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread Simen Kjaeraas
On Sun, 12 Aug 2012 06:11:48 +0200, Jonathan M Davis 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. -- Simen

Re: Do infinite bidirectional ranges make any sense?

2012-08-12 Thread bearophile
Jonathan M Davis: Can anyone think of any situation where an infinite bidirectional range would make any sense at all? I have implemented a simple Turing machine (to test a busy beaver) in D where the tape is finite in both directions, but when the machine tries to write past one of the ends

Re: Do infinite bidirectional ranges make any sense?

2012-08-11 Thread Philippe Sigaud
On Sun, Aug 12, 2012 at 6:11 AM, Jonathan M Davis wrote: > Can anyone think of any situation where an infinite bidirectional range would > make any sense at all? I find infinite ranges useful mainly to represent mathematical objects. I used them only twice: * to represent integers: front/popF

Do infinite bidirectional ranges make any sense?

2012-08-11 Thread Jonathan M Davis
As far as I can tell, there's nothing technically stopping an infinite range from being bidirectional, but I can't think of any case where such a range makes any sense at all. isRandomAccessRange is written specifically to allow infinite forward ranges be random access without being bidirection