lua-users home
lua-l archive

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




On Wed, Jul 3, 2013 at 2:18 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
function

exists(...)
   return not select('#', ...) == 0
end
local foo
print(exists(foo))
-->true
print(exists(baz))
--false --currently true

...
print(exists(a()))
--false --currently true

This already prints `false`. The list of return values can hold nothing, or one or more values.

print(exists(b()))
--false --currently true

Same here, already prints `false`.

should be?:

function exists(...)
   return not (select('#', ...) == 0)
end