Whither Tango?

Rainer Deyke rainerd at eldwood.com
Sat Feb 20 12:09:06 PST 2010


Andrei Alexandrescu wrote:
> Rainer Deyke wrote:
>> Andrei Alexandrescu wrote:
>>> Anyhow, what's a better name?

Python calls it 'range':
>>> range(1, 5)
range(1, 5)
>>> list(range(1, 5))
[1, 2, 3, 4]
>>>
>>> list(range(1, 5, 2))
[1, 3]

I like 'range'.  It's short, it's descriptive, it's immediately
recognizable to someone new to the language.

You could argue that calling this function 'range' would lead to
confusion between the range concept and the range function.  In that
case, you could add a verb and call the function 'makeRange'.
Alternately, if the function is only meant to take numeric arguments,
then 'numericRange' could help distinguish it from other functions that
return ranges.  However, I think that 'range' by itself is sufficiently
clear and unambiguous.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list