TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:

As I recall, it can handle the concept of Inf-1 etc.

Yes. But the Hyperreals do the same and stay within the realm
of set theory.

I'm not sure. A quick reading indicates that ⋆ℝ contains "infinitely large" numbers that maintain the properties of addition, but that is not the same as "infinity".


    my @evenodd = 0..Inf:by(2), 1..Inf:by(2);

can be indexed as follows

    say @evenodd[3]; # 6
    say @evenodd[Inf+1]; # 3
    say @evenodd[^3]; # 0 2 4
    say @evenodd[Inf «+« ^3]; # 1 3 5

Even in the finite case one has to know the index where the transition
from even to odd is made. In the infinite case this point has the nice
name Inf that's all. Good question is if one can expect

    say substr('ab' x Inf ~ 'ba' x Inf, Inf-1, Inf+1);

to print 'bb' on the rational that the structure is 'ab...abba...ba'

That's just not the way ∞ works.

I agree that the length of your file comprehension could be some number that is in ⋆ℝ that is "infinitely large" and not in regular ℝ, but it will still be less than ∞. In order to have +1 and -1 make sense, it needs to be some specific "infinitely large" integer, not the generic singularity of Inf.

In any case, the fact that there are so many different systems is a reason why you should be free to choose a module and not have it built in. If you, for example, C< use Conway::Surreal; >, then it could export new meanings of infix:<+> between Inf and Num and return a Surreal number.

With the core of the
language mandating the Inf type every programmer must be aware of
potentially infinite loops etc.

The programmer should be aware of how Inf behaves in comparisons and arithmetic. And the rule is that ∃x: x∈ℝ, ∞+x=∞.

--John

Reply via email to