<div id="reply-content">
        <br>
    </div>
    <div id="F6271E774C094679B9F3BC6D8419C318"></div>
     
    <p style="color: #A0A0A8;">Le jeudi 27 décembre 2012 à 13:40, David Precious a écrit :</p>
    <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
        <div id="quoted-message-content"><div><div>On Thu, 27 Dec 2012 12:46:20 +0100</div><div>Alexis Sukrieh &lt;sukria@sukria.net&gt; wrote:</div><div><br></div><blockquote type="cite"><div><div>Actually, the whole thing is that dancer_version (or major_version)</div><div>should clearly not be used for plugins to check their compatibility</div><div>with the core. Actually, what plugin should do is to use api_version.</div><div><br></div><div>Simple example :</div><div><br></div><div>Dancer 1.9999_01 is "Dancer 1" is you look at the VERSION (whatever</div><div>method you choose) but it's actually "Dancer 2" regarding its core.</div><div><br></div><div>So to summarize:</div><div><br></div><div>  - dancer_major_version should be removed, it has been added in a</div><div>rush, while releasing 1.9999_01 but was a mistake because of the</div><div>reason explained above</div><div>  - api_version should be used whenever something needs to check its</div><div>compatibility with the core</div></div></blockquote><div><br></div><div>I'm not sure; a lot of existing plugins use dancer_version, and it's</div><div>meaning is fairly clear.</div><div><br></div><div>I think the pragmatic approach is to let them continue to do so, with a</div><div>couple of tweaks:</div><div><br></div><div> - dancer_version can strip /_\d+$/ so that dev releases don't cause</div><div>   issues</div><div> - a special-case for D2 - e.g. return 2 if ($version &gt;= 1.9) - if the</div><div>   code is calling dancer_version, it most likely wants to know the</div><div>   difference between D1 and D2, I can't see that it's likely to be</div><div>   used in many other ways, you'd tend to use $Dancer::VERSION for that.</div></div></div></blockquote><div>Looks very close to my second proposal, so I'm all for it :)</div><div>&nbsp;</div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"><div id="quoted-message-content"><div><div><br></div><div>If that's no good, a potential other solution, which may be a little</div><div>voodish, is to return an object which uses overload to overload</div><div>stringification and comparison, so if you use it as a string (if you</div><div>wanted to output the current Dancer version) it gives you the full</div><div>version (perhaps minus the _\d+$ from a dev release), but if you use it</div><div>in a comparison (e.g. if (dancer_version &gt;= 2), it Does The Right</div><div>Thing).</div><div><br></div><div>What do you think?</div><div><br></div><div>Whatever we decide to do, if we do change the behaviour of</div><div>dancer_version a little it should be documented clearly.</div><div><br></div><div><br></div><div><br></div><div>-- </div><div>David Precious ("bigpresh") &lt;davidp@preshweb.co.uk&gt;</div><div>http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter</div><div>www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook</div><div>www.preshweb.co.uk/cpan        www.preshweb.co.uk/github</div><div><br></div><div><br></div><div>_______________________________________________</div><div>dancer-users mailing list</div><div>dancer-users@dancer.pm</div><div>http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</div></div></div>
         
         
         
         
    </blockquote>
     
    <div>
        <br>
    </div>