FAQ

On Tue, 2009-12-08 at 18:58 -0500, Austin Hastings wrote:
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.
You don't need to write this by hand. NQP-rx supports the method call
by name Perl 6 syntax:

$obj."$method_name"(...args...);

which makes this kind of thing much easier. I use it in Plumage in a
number of places.
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.
The above syntax is actually pretty close to the metal because it
translates directly to standard PIR ops.


-'f

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 6 | next ›
Discussion Overview
groupperl6-language @
categoriesperl
postedDec 8, '09 at 11:59p
activeDec 10, '09 at 5:31p
posts6
users3
websiteperl6.org

People

Translate

site design / logo © 2021 Grokbase