On Wed, May 11, 2005 at 11:45:12AM -0500, Jonathan Scott Duff wrote: > We're discussing the proper semantics of (1)[0] on #perl6. Here's > where we're at so far: > > 1. specialise ()[] to parse as (,)[] > 2. scalars are singleton lists, so ()[] naturally > 3. make (1)[0] die horribly.
(1)[0] means 1[0], which is probably undefined, so it dies. That could be detected at compile time. (my $foo = 1)[0] means $foo[0], which would die at runtime, unless there's type inference going on. In any case, I don't see a List in ()[] without a list-creating expression in the (). > -Scott -- wolverian
signature.asc
Description: Digital signature