On Mon, Jan 21, 2002 at 01:38:39PM -0800, Larry Wall wrote:
> Graham Barr writes:
> : On Mon, Jan 21, 2002 at 01:01:09PM -0800, Larry Wall wrote:
> : > Graham Barr writes:
> : > : But are we not at risk of introducing another form of
> : > : 
> : > :   my $x if 0;
> : > : 
> : > : with
> : > : 
> : > :   if my $one = <ONE> {
> : > :     ...
> : > :   }
> : > :   elsif my $two = <TWO> {
> : > :   }
> : > : 
> : > :   if ($two) {
> : > :     ...
> : > :   }
> : > 
> : > Then it's just undefined.  It's no different from how &&, ||, or ??::
> : > work when you put a declaration in something that's conditionalized.
> : 
> : Right. So we need to make sure that the implementation does that. In Perl5
> : my has a runtime part, so if it is not actually run then the lexical
> : can hold the value of the previous time it was executed.
> 
> Well, true enough.  Perhaps "undefined" is too meaningful.  We could
> borrow a phrase from Ada culture and just call it "erroneous".

Either that, or instead of my having a runtime element, we just initialize
all lexicals at the start of the block in which they are declared. So the
initialize step is not controlled by runtime effects.

I guess whether or not this (bug?) arises again depends on how parrot
implements lexicals.

Graham.

Reply via email to