Daniel Chetlin <[EMAIL PROTECTED]> wrote:
> What is it about automatic conversion to bigints (done well) that scares
> you?

Well, consider the following perl5 code:

sub factorial {
        my $n = shift;
        my ($f,$i) = (1,0);
        $f *= ++$i while $i < $n;
        $f;
}

Someone might be suprised and annoyed to find that when run under perl6,
it suddenly runs slowly and uses loads of memory.

I'd argue that at the language level there should be pragma allowing you
to choose between optimising for precison and optimising for speed/storage
(assuming these last two are synonymous).
If the default is speed/storage, then you get the perl5-ish behaviour of
int overflowing to float, and float overflowing to Infinity.
Under 'use precision' or whatever, ints overflow to bigints, floats
overflow to bigfloats etc.
Then everyone is happy. (Perhaps....)

Reply via email to