rafl/moosex-declare — pull request #6 by friedo (2011-11-17 03:09:33+00:00)
Title: Declare versions for classes and roles

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 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