bigint does bot overload range operator
pg
created: 2005-10-02 00:15:40

According to the doc of bigint, it claims that all operators are overloaded:

"All operators (including basic math operations) are overloaded."

But this gives error:

use strict;
use warnings;

use bigint;
print 2 ** 31 -1; 
for (1 .. 2 ** 31 - 1) {
	print ".";
}
Range iterator outside integer range at math1.pl line 6.
Re: bigint does bot overload range operator
rir
created: 2005-10-02 00:19:47
.. is not overloadable.

Be well,
rir

Re^2: bigint does bot overload range operator
created: 2005-10-02 08:58:06
.. is not overloadable.
Is this because the overload moudule doesn't allow for it, or because it's truly not overloadable? I'm honetsly curious...

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Re^2: bigint does bot overload range operator
pg
created: 2005-10-02 13:14:39

That was what I guessed, but I had the same thought as thor, which to me is more important.

There must be some technical difficulty underneath, that made them to choose a easy way out and disable the ability to overload range operator. But I am on the same page as thor, logically there is no ground for that, and hopefully this will be opened up in the future.

Re: bigint does bot overload range operator
sk
created: 2005-10-02 01:41:34
I don't see a range opertator in this output -

#!/usr/bin/perl

use strict;
use warnings;
use overload;

print +("$_ = ", $overload::ops{$_},$/) for (keys %overload::ops);


3way_comparison = <=> cmp
dereferencing = ${} @{} %{} &{} *{}
str_comparison = lt le gt ge eq ne
with_assign = + - * / % ** << >> x .
binary = & | ^
iterators = <>
unary = neg ! ~
special = nomethod fallback =
num_comparison = < <= >  >= == !=
assign = += -= *= /= %= **= <<= >>= x= .=
mutators = ++ --
func = atan2 cos sin exp abs log sqrt int
conversion = bool "" 0+

perlmonks.org content © perlmonks.org and pg, rir, sk, thor

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03