Re: What does ^parents really tell you?

2018-07-30 Thread Siavash
"Returns the list of parent classes. By default it stops at Cool, Any or Mu, which you can suppress by supplying the :all adverb. With :tree, a nested list is returned." https://docs.perl6.org/routine/parents On 2018-07-29 21:57:21 +0430, Joseph Brenner wrote: > If you look at the type diagram

Re: What does ^methods really tell you?

2018-07-30 Thread Siavash
"Returns a list of public methods available on the class (which includes methods from superclasses and roles). By default this stops at the classes Cool, Any or Mu; to really get all methods, use the :all adverb. If :local is set, only methods declared directly in the class are returned." http

What does ^methods really tell you?

2018-07-30 Thread Joseph Brenner
I originally thought that $var.^methods gave you a list of all available methods on $var, but it looks like it doesn't (always?) report on inherited methods. my $stringy = '3.14159'; say $stringy.^name; # Str say $stringy.^mro; # ((Str) (Cool) (Any) (Mu)) The list returned from checking $stri

Re: What does ^parents really tell you?

2018-07-30 Thread Joseph Brenner
Thanks! Both of these are workable, but the ^mro (method resolution order, I presume) is closer to what I wanted just now: my $stringy = 'abc'; say $stringy.^name; # Str say $stringy.^parents(:all); # ((Cool) (Any) (Mu)) say $stringy.^mro; # ((Str) (Cool) (Any) (Mu