develooper Front page | perl.perl6.language | Postings from July 2005

Re: Referring to package variables in the default namespace in p6

Thread Previous
From:
Dave Whipp
Date:
July 21, 2005 10:56
Subject:
Re: Referring to package variables in the default namespace in p6
Message ID:
20050721175553.24852.qmail@lists.develooper.com
"TSa (Thomas SandlaƟ)" wrote:

> Here your expectations might be disappointed, sorry.
> 
> The non-symbolic form $*Main::foo = 'bar' creates code that
> makes sure that the lhs results in a proper scalar container.
> The symbolic form might not be so nice and return undef!
> Then undef = 'bar' of course let's your program die.

When something knows that it is being evaluated in lvalue context, it 
should probably return something like "undef but autovifify:{...}". The 
assignment operator could then check for the "autovivify" property when 
its LHS is undefined.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About