in reply to Re^2: c-style for loop versus list for loop, and bigint
in thread c-style for loop versus list for loop, and bigint

>Is that intentional?

let's say it's historical. :)

I suppose the range iterator is just older than bigint.

I wouldn't be surprised if bigint is just just a hack to overload scalars with objects and the effect of iterating over a range was forgotten.

Cheers Rolf

  • Comment on Re^3: c-style for loop versus list for loop, and bigint

Replies are listed 'Best First'.
Re^4: c-style for loop versus list for loop, and bigint
by BrowserUk (Patriarch) on May 19, 2011 at 20:55 UTC

    Actually, I'm fairly certain that the conversion of the range operator from a list generator to an iterator happened long after bigint was available.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      hmm could be, I was thinking of the operator not of the iterator, but when using reverse one should get a list like before and it doesn't help either:

      use bigint; my $answer = 1; print ref $answer; # prints "Math::BigInt" for my $i (1..1) { print ref $i; # prints nothing } for my $i (reverse 1..2) { print ref $i; # prints nothing }

      Lets be honest, these kind of problems are one of the reasons why Python is more popular for scientific calculations.

      Cheers Rolf