[PATCH v2 1/8] lua: fix decimal comparison with nil

Vladimir Davydov vdavydov.dev at gmail.com
Wed Aug 14 14:00:49 MSK 2019


On Thu, Aug 08, 2019 at 02:55:52PM +0300, Serge Petrenko wrote:
> diff --git a/test/app/decimal.result b/test/app/decimal.result
> index b53f4e75d..633f3681a 100644
> --- a/test/app/decimal.result
> +++ b/test/app/decimal.result
> @@ -223,6 +223,32 @@ b
>   | - '0.1'
>   | ...
>  
> +-- check comparsion with nil
> +a == nil
> + | ---
> + | - false
> + | ...
> +a ~= nil
> + | ---
> + | - true
> + | ...
> +a > nil
> + | ---
> + | - false
> + | ...
> +a < nil
> + | ---
> + | - false
> + | ...
> +a >= nil
> + | ---
> + | - false
> + | ...
> +a <= nil
> + | ---
> + | - false
> + | ...

== and ~= are fine, but <=, <, >, >= look weird. Besides, they won't
work with numbers and strings. So I don't think it's a good idea to
introduce this functionality for decimals. Could you please implement
comparison with nil only for == and ~= operators?



More information about the Tarantool-patches mailing list