Skip to content
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

Closed
schwern opened this issue Feb 26, 2011 · 7 comments
Closed

Implement type checks with Any::Moose #3

schwern opened this issue Feb 26, 2011 · 7 comments

Comments

@schwern
Copy link
Contributor

schwern commented Feb 26, 2011

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.

@chloe-zen
Copy link

Conditionally loaded, I concur. No competing validation system has a much coverage as the Moose world

@schwern
Copy link
Contributor Author

schwern commented Mar 3, 2011

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.

@barefootcoder
Copy link
Contributor

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. :)

@schwern
Copy link
Contributor Author

schwern commented Mar 7, 2011

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.

@barefootcoder
Copy link
Contributor

To the first point, I think it's enough to say that Moose and Mouse may have slight differences ...

Good point. Saves us having to change the documentation every time something changes on the Mouse/Moose side.

Any::Moose will be a dependency of Method::Signatures. So you'll always have Mouse installed.

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. :)

@schwern
Copy link
Contributor Author

schwern commented Mar 8, 2011

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.

@barefootcoder
Copy link
Contributor

If it works for you, it works for me. :) I'll just make the Moose checking part conditional then.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants