>if i can rewrite it why can't i let pike do it for me?
Because then we would have to rewrite all of pike as opposed to some
specific operations in your program. Integers are used in a lot of
places.
>just to keep it in line with: "All so that you morons can write crappy
>code and still have it running fast as a breeze.... "
It still won't run fast as a breeze if you go over 4294967295 (on a
32-bit machine). There are rather few cases where numbers in the
range 2147483648..4294967295 are substantially frequent in the
domain.
>how would you rewrite an array of ipaddresses for example?
>
>something like this?
>
>class IPAddressList
>{
> array(int(-2147483648..2147483648)) ipaddresslist = ({});
> int `[](int index)
> {
> return ipaddresses[index]+2147483648;
> }
>}
Your example is incomplete. Why would you want the index operator of
an "IPAddressList" to return an integer in the range 0..4294967295?
That doesn't make any sense. Without seeing the whole program, I
can't know what the best way to rewrite it is, but I imagine a more
natural and useful version of the class would be this:
class IPAddressList
{
array(int) ipaddresslist = ({});
string `[](int index)
{
int n = ipaddresses[index];
return sprintf("%d.%d.%d.%d",
(n>>24)&255, (n>>16)&255, (n>>8)&255, n&255);
}
}