The new, new phobos sneak preview
Lars Kyllingstad
public at kyllingen.NOSPAMnet
Mon Apr 13 01:20:32 PDT 2009
Michel Fortin wrote:
> On 2009-04-12 11:09:51 -0400, Lars Kyllingstad
> <public at kyllingen.NOSPAMnet> said:
>
>> Andrei Alexandrescu wrote:
>>> Lars Kyllingstad wrote:
>>>> I think isInfinite!() should be called isInfiniteRange!(). The
>>>> current name is, in my opinion, too general.
>>>
>>> I'm undecided about this (and similar cases). isInfinite sits inside
>>> std.range, so std.range.isInfinite is clear and
>>> std.range.isInfiniteRange feels redundant. On the other hand, I don't
>>> want to use too common symbols because then the user will be forced
>>> to prefix them whenever they clash.
>>
>> I'm not too worried about name clashes, I just think it sounds wrong.
>> If R is a range with infinitely many elements, I think it's more
>> correct to say "R is an infinite range" than to say "R is infinite".
>>
>> As an example of what I mean, let the range R be the sequence 1, 1/4,
>> 1/9, ...:
>>
>> alias Sequence!("1/(n*n)", 1) R
>>
>> Then, isInfiniteRange!(R) should obviously yield true. From a
>> mathematical standpoint, I think the result of isInfinite!(R) is less
>> obvious. Yes, the range has infinitely many elements, but none of them
>> are infinite, nor is their sum infinite.
>
> Perhaps it should be renamed to isUnbounded then.
...except that my example, and indeed any range produced by sequence,
recurrence, etc. are bounded at one end. Thus the term "infinite range"
is more precise, and fits in well with the mathematical terms "infinite
series" and "infinite sequence". Just not "infinite" alone. :)
-Lars
More information about the Digitalmars-d
mailing list