On Wed, Aug 12, 2009 at 04:25:49PM -0500, Kyle Hasselbacher wrote:
> use v6;
> 
> my $s;   #  ! $x.defined
> my @a;  # @a.defined
> 
> That's the current Rakudo behavior.  RT #64968 suggests that this is a
> bug.  In Perl 5, @a would not be defined until something was put into
> it.  Which should it be?  I'd like to write a test for this.

http://perldoc.perl.org/functions/defined.html

    Use of defined on aggregates (hashes and arrays) is deprecated. It used
    to report whether memory for that aggregate has ever been allocated.
    This behavior may disappear in future versions of Perl. You should
    instead use a simple test for size:


I don't know whether the Perl 6 apocalypses explicitly specify behaviour for
defined, or if they inherit this Perl 5 behaviour by default.

Nicholas Clark

Reply via email to