On Sun May 03 13:51:11 2009, s1n wrote: > I ran into a bug where I couldn't refer to 'self' when it logically made > sense I could: > > (15:33:15) s1n: rakudo: class A { has %.H = (a => -> $x { self.c($x) });
I don't see anything in the spec that indicates that the body of the class declaration has a lexical 'self', or that it should be pre-set to the type object (formerly protoobject). AFAICT 'self' is only defined for method bodies, and it's the invocant of the method. If that's not the case, we probably need a spec update. In the meantime, I'm changing the title of this ticket to more accurately reflect the question at hand. Also, S12 indicates that C<self> is a function, whereas we currently implement it as a lexical. If it needs to be a function, we can probably arrange that. (And perhaps it's a contextual lookup of some sort.) Thanks, Pm