[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Adding a Return() function
- From: Hao Wu <wuhao.wise@...>
- Date: Tue, 16 Dec 2014 23:25:42 -0800
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