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

Declare versions for classes and roles #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

friedo
Copy link

@friedo friedo commented Nov 17, 2011

This is a change that allows you to declare version numbers for your classes and roles, similar to the package Foo v1.2.3 syntax.

Using MX::D, you can now say

class Foo v1.2.3 { ... } or role Bar v1.2.3. The version numbers must appear before any options, but otherwise extends and with and so forth work fine.

The parser creates a version object from the supplied version number and uses it to alter the generated package statement behind-the-scenes, so you end up with something looking like { package Foo v1.2.3; ... }.

It's a pretty rough sketch of the feature, but it works. I'd love to hear any additional ideas for it.

I added t/version.t to test it.

Mike

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

Successfully merging this pull request may close these issues.

1 participant