[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is everything an expression?
- From: steve donovan <steve.j.donovan@...>
- Date: Sun, 8 Sep 2013 17:46:34 +0200
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.