Stupid little iota of an idea

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Feb 10 18:19:13 PST 2011


Make to! smarter?

auto someRange = to!range(0, 5);

Here's python:
>>> range(5, 10)
[5, 6, 7, 8, 9]
>>> range(0, 10, 3)
[0, 3, 6, 9]
>>> range(-10, -100, -30)
[-10, -40, -70]

And D would be:
to!range(5, 10);
to!range(5, 10, 3);
to!range(-1, -100, -30);

But abusing the range word might be bad. I dunno..


More information about the Digitalmars-d mailing list