I'm writing some NQP, which isn't quite perl6, and I've got this method:

   method afterall_methods() {
       my @methods := self._afterall_methods;
unless @methods {
           @methods := self.fetch_afterall_methods;
           self._afterall_methods(@methods);
       }
return @methods;
   }

I've also got methods named 'after_methods', 'before_methods', 'beforeall_methods'. It's pretty much a search/replace kind of thing.

I know that I could 'metaprogram' this stuff by using string manipulation on the various method names, and then calling a (self-built) call_method($obj, $method_name, ...args...) function.

But I'm curious if there's some P6 feature I've forgotten about (which I've forgotten most of them, excepting the rev number) that would let me do this without having to go too far away from the metal.

Thanks,

=Austin

Reply via email to