lua-users home
lua-l archive

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


On 12.11.2012 22:00, spir wrote:

>> Indeed, it seems quite related. Again, it looks like you are using Lua
>> 5.1 instead of Lua 5.2:
>>
>> Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>>> print(string.format("%s", true))
>> stdin:1: bad argument #2 to 'format' (string expected, got boolean)
>>
>>
>> Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
>>> print(string.format("%s", true))
>> true
> 
> Right, I understand, but then why does it work in simple test cases (and
> also in some cases from my project files)? The parameters I give to my
> editor --geany-- about the run command don't change in the meantime,
> it's the same lua beeing launched in both cases. Also, i have tried from
> the command-line directly. Anyway, as shown in a previous message, I
> don't have lua 5.1. In usr/bin/, I have lua5.2, luac5.2 and 2 symlinks
> lua, luac. And 'which' finds lua, lua 5.2, but no lua 5.1 (unless lua5.1
> the program was called by another name?).

That tells us nothing about the version you are using. If you want to be
sure, on such error print _G._VERSION so you know which interpreter
generates the error (you can use pcall on suspected code block).

Regards,
miko