lua-users home
lua-l archive

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

> hmmm, couldn't one say that the Lua function 'function(x) end'
> expects one argument and 'function(x, y, ...) end' expects at least
> two arguments, irrespective of how many they actually receive ?

function take(i, a, b)
  if i == 1 then return a
   else return b

print(take(1, "hello"), take(2,nil,"world"))