Page 1 of 2

t.version

Posted: Wed Sep 21, 2011 3:01 am
by hryx
In love.conf, t.version is supposed to represent the intended Love version with a Lua number. But Love versions are things like "0.7.2", which is not a valid Lua number. Saying

Code: Select all

t.version = 0
is not meaningful, because features change enough between 0.x versions to break backwards-compatibility (in some cases).

So what use does t.version have? Is it going to change in the future, maybe to accept a string?

Re: t.version

Posted: Wed Sep 21, 2011 6:22 am
by Robin
It is currently not used, but if it will be in the future, it will probably be like this:

Code: Select all

-- 0.7.2
t.version = 072
-- 3.2.0
t.version = 320

Re: t.version

Posted: Wed Sep 21, 2011 6:31 am
by hryx
Cool. But to Lua, 032 looks like 32, so it could represent love version 32, or 3.2, or 0.3.2, etc. Why not use a string?

Code: Select all

t.version = '0.3.2'
Less ambiguous. I see the virtue in using numbers for the sake of comparisons (e.g. requiring at least version 0.7.0), but that can still be done easily by processing a string.

Re: t.version

Posted: Wed Sep 21, 2011 6:40 am
by Taehl
So far, I've been using "t.version = 0.72"...

Re: t.version

Posted: Wed Sep 21, 2011 7:11 am
by Robin
hryx wrote:Cool. But to Lua, 032 looks like 32, so it could represent love version 32, or 3.2, or 0.3.2, etc.
No, because 3.2 would be 320, as I said. Version 32 would be 3200.
Taehl wrote:So far, I've been using "t.version = 0.72"...
The disadvantage of that is that version 0.1 is actually something like 0.100000000001. Damn floating points. :P

Re: t.version

Posted: Wed Sep 21, 2011 8:25 am
by miko
Robin wrote:
hryx wrote:Cool. But to Lua, 032 looks like 32, so it could represent love version 32, or 3.2, or 0.3.2, etc.
No, because 3.2 would be 320, as I said. Version 32 would be 3200.
Taehl wrote:So far, I've been using "t.version = 0.72"...
The disadvantage of that is that version 0.1 is actually something like 0.100000000001. Damn floating points. :P
So what would be 3.11.2 and 3.1.12? I would prefer strings, this is how most GNU software works like. It is easy to do:

Code: Select all

major, minor, patchlevel=t.version:match('(%d+)%.(%d+)%.(%d+)%.')

Re: t.version

Posted: Wed Sep 21, 2011 8:29 am
by hryx
Robin wrote:No, because 3.2 would be 320, as I said. Version 32 would be 3200.
Oh, I see. This number would always assume x.y.z version numbering. That works, but it relies on y and z being single digits. It assumes there will never be a version like 0.8.12 or 2.10.0, where there have been more than 9 minor or incremental version upgrades.

For that reason, I still think that's less clear and flexible than using a string.

Edit: miko beat me to the same point.

Re: t.version

Posted: Wed Sep 21, 2011 5:11 pm
by Robin
Take it up with the devs, I'd say. ;)

Open a ticket or something.

Re: t.version

Posted: Wed Sep 21, 2011 9:57 pm
by BlackBulletIV
I personally use something like

Code: Select all

t.version = 072
because that's the format used internally by LOVE.

Re: t.version

Posted: Wed Sep 21, 2011 11:52 pm
by hryx
I have opened this up as ticket #299 on the issue tracker.

Miko, I referred to your parsing statement. But I took off the final "%.", which is superfluous.