lua-users home
lua-l archive

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


function Foo( s )
    --- check this out..
    return (type(s) == "string") and string.format("[%q]", s) or
string.format("[%d]", s )
end

Foo(1) --- "[1]"
Foo("ok") --- ["ok"]


I thought that this way was working with everything ... isn't it ?