On Sun Dec 14 02:26:54 2008, masak wrote: > It feels a bit odd that the below two one-liners don't work the same > way in Rakudo r33860. > > $ perl6 -e 'class A { my $a = method { say self.WHAT }; method x { > self.$a() } }; A.new.x' > A > > $ perl6 -e 'my $a = method { say self.WHAT }; class A { method x { > self.$a() } }; A.new.x' > invoke() not implemented in class 'Undef' > [...] > Actually it's a different problem. Because this works:
my $a = method { say self.WHAT }; class A { method x($m) { self.$m() } }; A.new.x($a) It's actually because lexicals declared in the outer scope of a class are not visible within the class (which in turn is, IIRC, due to a :load :init with :outer bug in Parrot). So changing the title of this ticket to reflect that. Thanks, Jonathan