Angel Faus wrote:
> 
> A few questions, about stuff I am not sure I got right. Sorry if this
> has already been resolved.
> 
> - What is the default behaviour (without using any pragma) of 1/0?
>   NaN or exception?

Unknown (open issue).  :-(

> - Are these correct? What will they do?
> 
>   my Int $i is bigint = 777_666_555_444_333_222_111;
>   print $i;

I don't think we'll need the 'is bigint' part; I think Int will
automatically know it needs to be a bigint, and do the right thing.

>   my Int $i = 777_666_555_444_333_222_111;
>   print $i;

.... so this is the typical form if you're specifying a bigint.

>   my $i =  777_666_555_444_333_222_111;
>   print $i;

My guess is that $i ends up storing an C<Int>, which handles the bigint
correcly.  Note that the variable $i is untyped, but that doesn't mean
the value it is storing is untyped.  It just means it can store values
of any possible (scalar) type.  So the code that reads in literal
numbers will recognize that the above number must be represented
internally as an C<Int>, not an C<int>, and do so.

> - Do Perl programs use a standard-sized platform-indepedent arithmetic
> by default, or do they relly on the native size?

Unknown (open issue).

We need to hear from the design team on that last point -- whether Perl
will assure that C<int> is always 32 bit, for example, or if C<int> is
platform-dependent.  My guess is the latter.  We will possibly have
access to the Parrot types C<int8>, C<int16>, C<int32>, and C<int64> for
cases where it is important to represent an explicitly sized int.

MikeL

Reply via email to