Ranges

pascal111 judas.the.messiah.111 at gmail.com
Sat Aug 6 21:10:09 UTC 2022


On Saturday, 6 August 2022 at 15:54:57 UTC, H. S. Teoh wrote:
> On Sat, Aug 06, 2022 at 03:37:32PM +0000, pascal111 via 
> Digitalmars-d-learn wrote:
>> On Friday, 5 August 2022 at 04:05:08 UTC, Salih Dincer wrote:
>> > On Thursday, 4 August 2022 at 22:54:42 UTC, pascal111 wrote:
>> > > [...]
>> > 
>> > Ranges and Slices are not the same thing. Slicing an array 
>> > is easy. This is a language possibility. For example, you 
>> > need an incrementing variable for the Fibonacci Series.
>> > 
>> > SDB at 79
>> 
>> What!!! so where's ranges?! I thought slices of any array are 
>> ranges, and understood it like that, and also there's no data 
>> type called ranges, it's like if you are talking about Ghostly 
>> data type!
>
> A range is any type that supports the Range API defined in 
> std.range (i.e., .empty, .front, .popFront). For more 
> explanations, read:
>
> 	http://www.informit.com/articles/printerfriendly.aspx?p=1407357&rll=1
> 	http://ddili.org/ders/d.en/ranges.html
> 	http://dconf.org/2015/talks/davis.html
> 	http://tour.dlang.org/tour/en/basics/ranges
> 	http://wiki.dlang.org/Component_programming_with_ranges
>
>
> T

You know, the problem is that ranges in D lack the usage of 
pointers as an essential tool to make all of ranges functions 
they need. If ranges exist in C, they would use pointers, and 
this is a powerful point in the account of C.


More information about the Digitalmars-d-learn mailing list