lua-users home
lua-l archive

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


On Fri, Feb 25, 2011 at 4:03 PM, Enrico Colombini <erix@erix.it> wrote:
> On 25/02/2011 21.35, Javier Guerra Giraldez wrote:
>>
>> if you return at most one value, just wrap your function call in
>> parenthesis.
>>
>> table.insert (t,(f()))
>
> Or, more explicitly, table.insert(t, f() or nil)

These are not the same. If f() returns false then yours incorrectly inserts nil.


-- 
- Patrick Donnelly