Subject says it all. I would like to know if my host interpreter is running Lua 5.2 or 5.1
相关问题
- How to get the return code of a shell script in lu
- Android version code for App updating
- Modelica libraries use different MSL version
- Accessing Light userdata in Lua
- Wireshark dissector that works with tls/ssl
相关文章
- Lua Integer type
- PowerShell ISE: how to run new PowerShell version
- First character uppercase Lua
- How to run two different nodejs applications with
- torch / lua: retrieving n-best subset from Tensor
- Get OSVersion in Windows using C++
- How to handle errors when resuming a Lua thread (c
- Is Lua an object-oriented language?
If you also need the third digit in Lua version (not available in
_VERSION
) you need to parse the output oflua -v
command on the command line.For platforms that support io.popen this script will do the trick, but only if the script is run by the standalone interpreter (not in interactive mode).IOW the
arg
global table must be defined:Note that
lua -v
writes onstderr
on Windows (for Linux I don't know), so thecommand
for io.popen (which only capturesstdout
) must redirectstderr
tostdout
and the syntax is platform-specific.There is global variable _VERSION (a string):
UPD :
Other methods to distinguish between Lua versions:
UPD2 :
_VERSION
holds the interpreter version. Check the manual for reference.