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 - [email protected]
