Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
hryx
Party member
Posts: 110 Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA
Post
by hryx » Wed Sep 21, 2011 3:01 am
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
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?
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Wed Sep 21, 2011 6:22 am
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
hryx
Party member
Posts: 110 Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA
Post
by hryx » Wed Sep 21, 2011 6:31 am
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?
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.
Taehl
Dreaming in associative arrays
Posts: 1025 Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:
Post
by Taehl » Wed Sep 21, 2011 6:40 am
So far, I've been using "t.version = 0.72"...
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet , built like a tank . But not fancy enough for Love2D 0.10.0+.
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Wed Sep 21, 2011 7:11 am
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.
miko
Party member
Posts: 410 Joined: Fri Nov 26, 2010 2:25 pm
Location: PL
Post
by miko » Wed Sep 21, 2011 8:25 am
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.
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+)%.')
hryx
Party member
Posts: 110 Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA
Post
by hryx » Wed Sep 21, 2011 8:29 am
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.
Robin
The Omniscient
Posts: 6506 Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:
Post
by Robin » Wed Sep 21, 2011 5:11 pm
Take it up with the devs, I'd say.
Open a ticket or something.
BlackBulletIV
Inner party member
Posts: 1261 Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:
Post
by BlackBulletIV » Wed Sep 21, 2011 9:57 pm
I personally use something like
because that's the format used internally by LOVE.
hryx
Party member
Posts: 110 Joined: Mon Mar 29, 2010 2:28 am
Location: SF<CA<USA
Post
by hryx » Wed Sep 21, 2011 11:52 pm
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.
Users browsing this forum: Bing [Bot] and 1 guest