Declare versions for classes and roles #6

wants to merge 2 commits into


None yet
1 participant

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.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment