[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: math.min, math.max
- From: Coroutines <coroutines@...>
- Date: Wed, 9 Apr 2014 11:26:42 -0700
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
- References:
- math.min, math.max, Dirk Laurie
- Re: math.min, math.max, Oliver Kroth
- Re: math.min, math.max, Dirk Laurie
- Re: math.min, math.max, Hisham
- Re: math.min, math.max, Roberto Ierusalimschy
- Re: math.min, math.max, Andrew Starks
- Re: math.min, math.max, Dirk Laurie
- Re: math.min, math.max, Coroutines
- Re: math.min, math.max, Dirk Laurie