Carl Mäsak writes:
> my $foo;
> # ...later in the same scope...
> my $foo; # illegal Perl5, legal Perl6
That isn't illegal in Perl 5. It yields the warning:
"my" variable $foo masks earlier declaration in same scope
but it does work.
Smylers
Dave (>), Carl (>>):
> my $foo;
> # ...later in the same scope...
> my $foo; # illegal Perl5, legal Perl6
No, that's perfectly legal in perl5; it just generates a warning:
use warnings;
my $x = 1;
my $f1 = sub { $x };
my $x = 2;
my $f2 = sub { $x };
printf "f1=%d f2=%
On Sat, Jan 27, 2007 at 10:23:03AM +0100, Carl Mäsak wrote:
> my $foo;
> # ...later in the same scope...
> my $foo; # illegal Perl5, legal Perl6
No, that's perfectly legal in perl5; it just generates a warning:
use warnings;
my $x = 1;
my $f1 = sub { $x };
my $x = 2;
my $f2
Steve Lukas (>):
Hi @larry,
I want to remember to my proposal from september 2006.
It targets on changing S04. The discussion is summarized on:
http://www.oreillynet.com/onlamp/blog/2006/09/weekly_perl_6_mailing_list_sum_3.html
So, please change S04 as discussed.
I, too, would like to point to
Hi @larry,
I want to remember to my proposal from september 2006.
It targets on changing S04. The discussion is summarized on:
http://www.oreillynet.com/onlamp/blog/2006/09/weekly_perl_6_mailing_list_sum_3.html
So, please change S04 as discussed.
Thanks
Stefan
-
Steve (>):
"If you declare a lexical twice in the same scope, it is the same lexical"
I would argue for: If you declare a lexical twice in the same scope, it is an
error!
I agree.
Enforcing one and only one declaration feels like a Good Thing, for
Juerd's reasons. With me, multiple 'my' for
Steve Lukas skribis 2006-09-11 4:35 (-0700):
> "If you declare a lexical twice in the same scope, it is the same lexical"
> I would argue for: If you declare a lexical twice in the same scope,
> it is an error!
I agree.
The reason that I love "my $foo" is that it always gives me a new
variable.
On Mon, Sep 11, 2006 at 04:35:08AM -0700, Steve Lukas wrote:
>
> I would argue for: If you declare a lexical twice in the same scope, it is an
> error!
>
> Well, this error happens most likely due to my tiredness and I want the
> compiler to wake me up.
> This can be important because I would
Hello,
perhaps I've missed a discussion about it, but I can't find a reason for a
(IMHO infelicitous) specification. In S04 is said:
"If you declare a lexical twice in the same scope, it is the same lexical"
I would argue for: If you declare a lexical twice in the same scope, it is an
error!