1. Anders Ruud
  2. love
  3. Issues


Issue #809 resolved

Restore love.system.getVersion

Preston Mays
created an issue

Now that the system module is back, is there any compelling reason not to change the 'global' variables love._version, love._version_codename and their ilk back into a nice, clean, API-nated set of functions like getVersion and getCodename?

Comments (6)

  1. Anders Ruud repo owner

    That's probably a good idea. I would suggest just one function, though:

    version, codename = love.system.getVersion()

    ... or perhaps just not expose the codename.

  2. Preston Mays reporter

    Don't take away codenames, for they are awesome!

    Here's what I'm thinking:

    version = love.system.getVersion()
    codename = love.system.getCodename()
    major, minor, patch = love.system.getRevision()

    I've always preferred the naming style major.minor.patch to major.minor.revision re: semantic versioning. If you think about it, every new release is a revision, but a patch fixes a minor release of a major version.


    codename = love.system.getVersionCodename()
    major, minor, revision = love.system.getVersionNumbers()
  3. Alex Szpakowski

    One thing to keep in mind: it's useful to be able to see the current LÖVE version inside conf.lua (which is executed before almost every LÖVE module is loaded), so even if/when the version can be retrieved via love.system, it would be good to keep it easily accessible from conf.lua one way or another.

  4. Alex Szpakowski

    How about this:

    love.system.getVersion() == "0.9.1"
    love.system.getVersion("major") == 0
    love.system.getVersion("minor") == 9
    love.system.getVersion("revision") == 1 -- or getVersion("patch")?
    love.system.getVersion("codename") == "Baby Inspector"

    On the other hand it doesn't solve the issue I mentioned above, and having a function return multiple types of values is a little weird.

  5. Alex Szpakowski

    Added love.getVersion (resolves issue #809).

    Syntax is: major, minor, revision, codename = love.getVersion().

    → <<cset fbd8fad9c0ec>>

    I moved it out of love.system because it's the version of LÖVE itself, not a system-specific thing. This also lets it be used before modules are loaded.

  6. Log in to comment