develooper Front page | perl.perl6.language | Postings from March 2002

Re: Topicalizers: Why does when's EXPR pay attention to topicaliz er r egardless of associated variable?

Thread Previous | Thread Next
From:
Larry Wall
Date:
March 27, 2002 08:21
Subject:
Re: Topicalizers: Why does when's EXPR pay attention to topicaliz er r egardless of associated variable?
Message ID:
200203271620.IAA12905@wall.org
Aaron Sherman writes:
: Here's an example syntax:
: 
: FOO: for @x {
:   BAR: for @y {
:     my $foo_under FOO:= $_;
:     print $_, $foo_under;
:   }
: }

I think if we have to go through contortions to get at the outer topic
by name, it's better to just name the variable on the outer loop in the
first place.  Adding -> $varname to the outer loop is safe, because it
doesn't change the semantics of topicality--now that we changed the
rule so that $_ is always aliased to the topic regardless of whether
it's aliased to an explicit variable name.

Larry

Thread Previous | Thread Next


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