On Wed, Jan 14, 2009 at 01:28:10AM -0800, Carl Mäsak wrote: > <masak> rakudo: my $x = "foo"; class A { my $.y = $x } # bug? > <p6eval> rakudo 35518: OUTPUT«Lexical '$x' not found [...]
There's a known problem that we can't yet do outer lexicals from things that look like BEGIN blocks (in Parrot terms -- things that happen at :load :init time). I don't know when/how this will be fixed. > <masak> rakudo: our $x = "foo"; class A { my $.y = $x } > <p6eval> rakudo 35519: OUTPUT«Null PMC access in isa() [...] Since the body of class declarations happens at BEGIN time, the initialization of $y is occurring before $x is initialized (or even vivified). Granted, Rakudo should not be generating the Null PMC access message, but I also wouldn't expect $.y to be initialized to 'foo'. Pm