From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 15 Aug 2019 01:17:29 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 1/8] lua: fix decimal comparison with nil Message-ID: <20190814221729.GD28533@atlas> References: <20190814110049.GD13834@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814110049.GD13834@esperanza> To: Vladimir Davydov Cc: Serge Petrenko , tarantool-patches@freelists.org List-ID: * Vladimir Davydov [19/08/14 14:05]: > == 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? I checked how other data types behave in Lua: tarantool> "" > nil --- - error: '[string "return "" > nil"]:1: attempt to compare nil with string' ... tarantool> "" == nil --- - false ... tarantool> "" ~= nil --- - true ... tarantool> "" < nil --- - error: '[string "return "" < nil"]:1: attempt to compare string with nil' ... tarantool> 1 > nil --- - error: '[string "return 1 > nil"]:1: attempt to compare nil with number' ... tarantool> 1 == nil --- - false ... So, good point, I agree. -- Konstantin Osipov, Moscow, Russia