Shout out to D at cppcon, when talkign about ranges.

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 5 11:43:25 PDT 2015


On Thursday, 1 October 2015 at 07:37:28 UTC, deadalnix wrote:
> Well, yes and no. Sure I'm sure there are precedent for ranges, 
> be it in C++ or even I'm sure one can find them in other 
> languages. I'm sure someone in the 70s had something like 
> ranges already.

Yes, certainly in the 70s, but I would be surprised if something 
like it was not done for Lisp in the 60s? What D/C++ call ranges 
is iterators/generators. C++ mislabeled "table-pointers" as 
"iterators", which is a source for endless confusion. 
Co-routines, like the ones in Simula which was "stackless", can 
be viewed as a heavy async version of iterators/generators too. 
Adapters can be hooked up at runtime also (if speed is not a 
priority).

So, "ranges" are very common, with varying syntax/performance.



More information about the Digitalmars-d mailing list