develooper Front page | perl.perl6.users | Postings from July 2018

What does ^parents really tell you?

Thread Next
Joseph Brenner
July 29, 2018 17:27
What does ^parents really tell you?
Message ID:
If you look at the type diagram:

You can see that:
   Str is Cool is Any is Mu

But if you use the ^parents method on a string, you don't get
"Cool", instead you get "()":

   my $stringy = "abc";
   say $stringy.^name;      # Str
   say $stringy.^parents;   # ()

   say (Str).^parents;      # ()

So what exactly does ^parents tell you about?
Is there some other method you could use to trace the chain
of ancestors upwards?

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About