[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: module _VERSION number scheme proposal
- From: HyperHacker <hyperhacker@...>
- Date: Tue, 8 Nov 2011 21:35:49 -0700
On Tue, Nov 8, 2011 at 21:19, Miles Bader <firstname.lastname@example.org> wrote:
> 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
> in foul.
Isn't that generally called natural compare? It's used by smart file
browsers too so that file10.jpg doesn't list before file2.jpg.
Sent from my toaster.