Skip to content

Declare versions for classes and roles#6

Open
friedo wants to merge 2 commits into
rafl:masterfrom
friedo:master
Open

Declare versions for classes and roles#6
friedo wants to merge 2 commits into
rafl:masterfrom
friedo:master

Conversation

@friedo

@friedo friedo commented Nov 17, 2011

Copy link
Copy Markdown

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