lua-users home
lua-l archive

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




On Tuesday, December 16, 2014, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On Tue, Dec 16, 2014 at 8:38 PM, Soni L. <fakedme@gmail.com> wrote:
> if x or Return(nil, "missing x") then ... end
>
> vs
>
> if not x then
>   return nil, "missing x"
> else
>   ...
> end


vs.

if not x then return nil, "missing x" end
....    -- no need for 'else'

I think OP's point is return can be a function so it can be baked into the _expression_ v.s. a single statement, for simplicity. 
 
--
Javier