Hi All,

While reviewing a fix to my Test-(CPAN|JSON|YAML)-Meta distributions,
regarding optional_features, it was questioned what the key name in each
map should be. Below is an excerpt of a discussion between Kevin Ryde
and myself, via the RT#52685 [1]

[1] http://rt.cpan.org/Public/Bug/Display.html?id=52685

From: Kevin Ryde via RT <bug-test-yaml-m...@rt.cpan.org>

"Barbie via RT" <bug-test-yaml-m...@rt.cpan.org> writes:
>
> Although not explicitly stated in the current specifications (v1.0 -
> v1.4), the convention has been to precede user defined keys with
> "[xX]_".

That doesn't sound right for the optional features names.  The effect
would be that anything is allowed in lower case, but if you want upper
case you must write x_.

That x_ bit is for extensions to maps with spec-defined keys isn't it?
In the optional features names there isn't anything spec-defined, it's
all user-defined names, and you're free to write anything, isn't it?

Either way it would help for the spec to say something there, as I can't
imagine I'll be the last to wonder what it is or isn't supposed to be.


> as defined in the current blead version of v2.0 of the specification:

Sounds a bit dangerous to enforce future spec against META.yml's which
only declare themselves as 1.4 or whatever.

But my reading of that x_ would be that in 1.4 no unknown keys are
allowed (toplevel, requires maps, etc), but 2.0 allows unknown keys if
they begin x_, ie. a loosening ...

----- End forwarded message -----

Although the convention for the X_ naming is only stated in v2.0, it has
been discussed before and been considered acceptable. However, I think
Kevin makes a good point as to whether this should be backported.
Thoughts welcome.

Kevin also makes a good point regarding what characters should be
allowable in an optional feature key name. Currently there is no
specific mention of how optional features should be named (lower case?
preceding X_? any value in the character class \w?).

What would be the recommended naming convention for optional features?


Cheers,
Barbie.
-- 
Birmingham Perl Mongers <http://birmingham.pm.org>
Memoirs Of A Roadie <http://barbie.missbarbell.co.uk>
CPAN Testers Blog <http://blog.cpantesters.org>
YAPC Conference Surveys <http://yapc-surveys.org>


Reply via email to