lua-users home
lua-l archive

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


On Sun, Sep 8, 2013 at 4:47 PM, Seppl Vorderhörer
<Seppl.Vorderhoerer@t-online.de> wrote:
> 99% of all programmers seen as) "operations that use conditions and result
> in other conditions" are here really misused to not return booleans but
> other types.

Using 'or' like this is a popular Lua idiom, often used for default values:

function foo(a,b)
   a = a or 'one'
   b = b or 'two'
  ...
end

It is a _little_ odd at first, but then very liberating.

steve d.