On Sat, Sep 24, 2016 at 07:37:52AM +0000, Lloyd Fournier wrote:
> I think this is because .WHAT is a special case. It's not really a method
> which is what you need to make *.method work. *.WHAT will always return
> (Whatever) immediately.

You're correct that .WHAT is a special case.  From S12, "Introspection":

   These should all be considered built-in language primitives, 
   not true operators or methods, even if a given implementation 
   happens to implement one or more of them that way.

I suppose it's possible that *.WHAT should generate a WhateverCode object...
but I'm a little disinclined to that.  A bit later S12 continues:

   In general, use of these uppercased accessors in ordinary code
   should be a red flag that Something Very Strange is going on.
   (Hence the allcaps.)  Most code should use Perl 6's operators that
   make use of this information implicitly.  For instance, instead of

       $obj.WHAT === Dog
       ...

   you usually just want:

       $obj ~~ Dog

So I'd say this isn't actually a bug.

Pm


Reply via email to