On Wed Apr 22 06:25:42 2009, ronaldxs wrote:
>  From IRC below
> 
> 19:07 PhatEddy rakudo: my @x; say 'ok' if @x.defined
> 19:07 p6eval rakudo 69b318: OUTPUT«ok?»
> 
> The equivalent Perl 5 code says nothing unless you put something in @x 
> at some point.
> 
> This is similar to some other tickets like Rt 64928 
> <http://rt.perl.org/rt3//Public/Bug/Display.html?id=64928> and the 
> resolved Rt 62894 
> <http://rt.perl.org/rt3/Public/Bug/Display.html?id=62894> but seemed 
> somehow basic and distinct enough that, after asking on IRC, I am 
> submitting this as a new bug ...

I would say that it's similar to #64928, but unlike #62894.

Essentially, normal arrays (and hashes) are always defined in Perl 6. Even when 
they're empty, 
they're defined. Even when they've only been declared but not-yet-assigned to, 
they're 
defined. At least that's how I understand their semantics.

In other words, this is one of a number of differences between Perl 5 and Perl 
6, and the way 
Rakudo currently works is correct. Marking the ticket as rejected.

Reply via email to