[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: module _VERSION number scheme proposal
- From: Miles Bader <miles@...>
- Date: Wed, 09 Nov 2011 13:19:11 +0900
David Manura <email@example.com> writes:
> 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
> (e.g. 8d1985807b).
I think a simple "version_compare" function (version_greater, whatever)
would be more straight-forward; indeed, something like that already
exists in GNU libc -- strverscmp. The basic idea is: compare
lexigraphically, but compare any embedded integers as numbers.
Friendship, n. A ship big enough to carry two in fair weather, but only one