-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement type checks with Any::Moose #3
Comments
Conditionally loaded, I concur. No competing validation system has a much coverage as the Moose world |
Yes. Like everything in MS, you only pay for what you use. And Any::Moose will default to Mouse if something else hasn't already loaded Moose. |
Just a couple of quick notes on using Any::Moose thus far: *) Mouse doesn't seem to implement ScalarRef[Type] for some reason. Not that it's bothering me that much--I'll just move the test somewhere where I can guarantee that Moose is loaded first--but it's an oddity that I suppose we'll have to mention in the documentation (I'm also planning on updating the doco, BTW, in case anyone was worried about that). And hopefully that's the only real impact. *) So right now I have a test that verifies that, unless Moose is loaded before MS is use'd, Mouse will get loaded, and it won't get loaded until the type checking is actually called. But it occurs to me that I have no way to make this conditional on Any::Moose/Mouse being installed; if I do a skip block conditional on a use_ok, then Mouse gets loaded and my test to verify it's not loaded before the method is called fails. So I think I have to give up that test, unless someone else has a brilliant idea that I've just failed to see. :) |
To the first point, I think it's enough to say that Moose and Mouse may have slight differences which will become less and less as time goes on rather than document the current snapshot of their differences. Similarly, don't redocument the Moose type system. Just refer the user to the appropriate Moose docs. To the second, Any::Moose will be a dependency of Method::Signatures. So you'll always have Mouse installed. |
Good point. Saves us having to change the documentation every time something changes on the Mouse/Moose side.
Really? Since type checking will be optional, I figured you didn't want to intriduce a dependency that some people might not need. But it's no skin off my nose either way. :) |
Mouse is well maintained and has no dependencies. It's a far lighter dependency than what we already depend on. And we can use it internally. |
If it works for you, it works for me. :) I'll just make the Moose checking part conditional then. |
Now that we support type check syntax, we should do something with it by default. The simplest thing to do would be to use Any::Moose to do the type checking. It's a light dependency and Moose compatible.
The text was updated successfully, but these errors were encountered: