[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: module _VERSION number scheme proposal
- From: David Manura <dm.lua@...>
- Date: Tue, 8 Nov 2011 21:27:44 -0500
On Tue, Nov 8, 2011 at 1:58 AM, Vadim Peretokin <firstname.lastname@example.org> wrote:
> Neither of these are particularly human friendly.
> Why does it have to be triple digits and not trimmable?
>> On 8 November 2011 16:27, David Manura <email@example.com> wrote:
>> > I propose the following scheme for the _VERSION  variable in modules:
>> > Examples of valid versions include '001', '001.234', and
>> > '012.001.001.001'.
It is a trade-off. The main intention of the zero padding is to allow
versions to be compared by simple string comparison, i.e. without any
external version library like verlib .
local B = require 'baz'
local V = require 'verlib'
if V(B._VERSION) >= V'1.2.5' then
-- as opposed to just `B._VERSION >= '001.002.005'`
. . .
. . .
Implementing verlib in Lua would also be a valid approach though.
Should we bother? With git, we just accept unfriendly version numbers