Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^6: Introspection of Moose/Mouse attributes fails to find native trait with `does`

by chromatic (Archbishop)
on Aug 24, 2011 at 23:59 UTC ( [id://922232]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Introspection of Moose/Mouse attributes fails to find native trait with `does`
in thread Introspection of Moose/Mouse attributes fails to find native trait with `does`

One must assume that types are roles for this definition to be equivalent to yours.

That's exactly the assumption I made when I came up with roles.

Is there anything to support this assumption?

It's one of the two things I insisted on when we were working on Apocalypse 12. (The other is "They're not interfaces in the Java sense. They have to allow code reuse.")

Now Moose can do what Moose wants, but if Moose roles don't correspond directly to Moose types, one or the other is broken as per the formal model we designed.

How then can does check the type of the attribute if the attribute doesn't have a type?

That part I understand. You can squint and say "If it passes the type check, then it must also pass the role check", but I can understand why Moose's MOP wouldn't necessarily want to add a heuristic to guess about that.

  • Comment on Re^6: Introspection of Moose/Mouse attributes fails to find native trait with `does`
  • Download Code

Replies are listed 'Best First'.
Re^7: Introspection of Moose/Mouse attributes fails to find native trait with `does`
by perigrin (Sexton) on Aug 25, 2011 at 01:38 UTC

    In Moose a Role is (or at least connotes) a Type but a Type is not necessarily a Role. We've had this conversation once at YAPC in Columbus.

    Whether that is broken or not, it's a difference between Moose and Perl6.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://922232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-23 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found