Oddly, I chose the world's worst subject. I meant to go back and add
"^methods returning list of Subs?" but failed.



On Fri, Aug 7, 2009 at 3:16 PM, perl6 via RT
<perl6-bugs-follo...@perl.org>wrote:

> -------------------------------------------------------------------------
> I'm working in a firewalled environment today where I can't get access to
> git, so here's what I see in 2009-07 downloaded from
> http://github.com/rakudo/rakudo/downloads
>
> S12 says:
>
> "The .^methods method returns method-descriptors containing:
>
>    name                the name of the method
>    signature           the parameters of the method
>    as                  the coercion type of the method
>    multi               whether duplicate names are allowed
>    do                  the method body"
>
>
>
> That doesn't tell me exactly what I'm looking for, but I tried:
>
> > say Str.^methods[0]
> sprintf
>
> Which looks suspiciously like a single string, but just in case, I tried:
>
> > say Str.^methods[0]<signature>
> get_pmc_keyed() not implemented in class 'Sub'
> in Main (<unknown>:1)
> > say Str.^methods[0].^signature
> Method 'signature' not found for invocant of class 'P6metaclass'
> > say Str.^methods[0].signature
> No signature found
>
> That last one looks more promising, but still not quite as advertised.
> Oddly
> enough if I try another one of the "descriptors" listed, it gets stranger:
>
> > say Str.^methods[0].name
> pred
>
> eh? The rest of the names (as, multi, do) don't seem to exist at all. I
> expect that this is because I'm not actually looking at a "descriptor" at
> all, but rather a Sub object that stringifies itself to "sprintf". Is that
> a
> bug in Rakudo or S12?
>
>

Reply via email to