On Mon, Jun 28, 2004 at 11:10:03AM -0600, John Williams wrote:
> On Sun, 27 Jun 2004, Luke Palmer wrote:
>
> > Alexey Trofimenko writes:
> > > AFAIR, I've seen in some Apocalypse that lexical scope boundaries will be
> > > the same as boundaries of block, in which lexical variable was defined.
> >
> > Yep. Except in the case of routine parameters, but that's nothing new.
>
> (This may be a bit tangential, but it still concerns scope...)
>
> I am reminded of a strange case I came across in perl5, and I wondered how
> perl6 would behave for the following:
>
> $b = 'a';
> my $b ='b' , print "$b\n";
> print "$b\n";
>
> In perl5, this prints:
>
> a
> b
>
> Which seems to show that the "my $b" doesn't actually come into scope
> until the end of the statement in which it is defined. Is that correct?
> and what will perl6 do?
IIRC, perl6 will lexicalize $b as soon as it sees "my $b" so that it
should print
b
b
Assuming a left-to-right evaluation :)
-Scott
--
Jonathan Scott Duff Division of Nearshore Research
[EMAIL PROTECTED] Senior Systems Analyst II