Aaron Sherman (via RT) wrote:
> # New Ticket Created by  Aaron Sherman 
> # Please include the string:  [perl #68306]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68306 >
> 
> 
> 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,

It's not, it's just an object that returns the method name in string
context.


> but just in case, I tried:
> 
>> say Str.^methods[0]<signature>
> get_pmc_keyed() not implemented in class 'Sub'

You're trying to use a hash key, not calling a method.

$ perl6 -e 'say Str.^methods[0].signature'
Signature()<0x7fff2799f5b0>
$ perl6 -e 'say Str.^methods[0].signature.perl'
:(Object self, Any $encoding?, Any $nf?, Object *%_)

(Note that the order of the returned methods is not fixed, so you might
see something different).

>> say Str.^methods[0].name
> pred

Yes, there's a method 'pred'. So what?

> 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?

I think it's just not yet implemented.

Cheers,
Moritz

Reply via email to