lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


D'oh!  Sorry.  Hit "send" by accident.

On 10 November 2011 15:06, Michael Richter <ttmrichter@gmail.com> wrote:
I'm finding all this string- and float-fetish here a bit odd.  Is there some reason we can't just have version tables like this:

M1._version = { 1, 2, 3 }   // equivalent to version 1.2.3
M2._version = { 4, 5 }      // equivalent to version 4.5
M3._version = { 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 8 }
                            // equivalent to version dotted-pi

We could then have a standard module version metatable (initially a de facto standard, but later perhaps even officially blessed) that provides natural comparison semantics (so that 4.5 is greater than 1.2.3, for example), that provides a default printing format, both long-form and short-form even if you'd like and provides other versioning services.

--
"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.