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

Add an option to set default traits lexically. #66

Open
schwern opened this issue Feb 17, 2013 · 0 comments
Open

Add an option to set default traits lexically. #66

schwern opened this issue Feb 17, 2013 · 0 comments

Comments

@schwern
Copy link
Contributor

schwern commented Feb 17, 2013

Have an option to declare default traits to be applied to every parameter in this scope.

# Turn on coercion and make all parameters read only aliases.
use Method::Signatures { traits => { "coerce", "ro", "alias" } };

Use cases include turning on type coercion or making all parameters read-only.

Care must be taken because some traits are the opposites of the other. In the above example, you'd want "is rw" to override the default read only trait. Or you'd want "is copy" to override the default alias trait.

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

1 participant