lua-users home
lua-l archive

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


On Wed, Oct 7, 2009 at 3:36 PM, Geoff Leyland <geoff_leyland@fastmail.fm> wrote:
> I didn't know that!  You mean like this?
>
>> function a() end
>> function b() return nil end
>> =select("#", a())
> 0
>> =select("#", b())
> 1
>
> Or is there another way?

select is the only way to count the number of values in an expression
list (either, varargs ... or the return values from a function).

-- 
-Patrick Donnelly

"Let all men know thee, but no man know thee thoroughly: Men freely
ford that see the shallows."

- Benjamin Franklin