On Mon, Aug 11, 2008 at 12:08:21AM -0700, Carl Mäsak wrote:
> r30166:
> $ perl6 -e '999999[1]'
> get_pmc_keyed() not implemented in class 'Integer'
> [...]
> $ perl6 -e '1000000[1]'
> get_pmc_keyed() not implemented in class 'Float'
> [...]
> 
> So:
> 
> * For some reason, a literal integer followed by an array index makes
> it though parsing. Is it really valid standard Perl 6 syntax?

AFAICT, according to the grammar it's valid standard Perl 6 syntax.
Whether something else is supposed to catch this and throw an
exception is (as yet) unspecced.  But keep in mind that we can
do things like method calls on literals, so it seems that other
postfixish sorts of things are (syntactically) legal.

> * A Parrot error is thrown once the code is run. Even if code like
> this gets through the parsing stage (and we can't stop, say, integers
> in variables being array-indexed), the error should be trapped by
> rakudo.

At present Rakudo doesn't try to interpret all exceptions that Parrot
may throw and impose its own interpretations on them.  But suggestions
are welcome here.

> * Some magical limit between 999999 and 1000000 makes the error start
> talking about 'Float' rather than 'Integer'. This is also the point
> when numbers are written in exponential form, as 1+e6. Perl 5 handles
> integers of much higher magnitude by default.

I think this has to do with the way that integers are interpreted
in PIR.  I'm not exactly certain how we want to resolve it, but
it's likely going to require some help from Parrot.  (Either that
or we get POST to compile to bytecode directly and avoid the PIR
translation altogether.)

Pm

Reply via email to