lua-users home
lua-l archive

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


On Wed, Apr 9, 2014 at 11:20 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> Though possible, the distinction between returning nothing and
> returning some nils is messy --  select('#',fct(...)) -- and not
> accepted practice.

I recognize this :>

My reasoning is that:

return
return nil, 'error'

-- both of these suit propagating an error, but I feel like the 2nd
should be used if you signal an error by explicitly returning nil.
Unless you have an string-error to return, I feel like nothing would
be more appropriate.

Not dropping this, I would really love to see a global max()/min() for
metamethod __gt/__lt :p