From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0358D2694F for ; Tue, 23 Apr 2019 11:05:33 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FOB2dgwSM3Re for ; Tue, 23 Apr 2019 11:05:32 -0400 (EDT) Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id B3788267DE for ; Tue, 23 Apr 2019 11:05:32 -0400 (EDT) Date: Tue, 23 Apr 2019 18:05:30 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v1 1/1] lua: export key_def methods for LUA key_def object Message-ID: <20190423150530.GB5668@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: alexander.turenko@tarantool.org, Kirill Shcherbatov * Kirill Shcherbatov [19/03/25 15:29]: > Functions extract_key, compare, compare_with_key, merge defined > for key_def introduced for LUA key_def object. > > Close #4025 > > @TarantoolBot document > Title: Built-in methods for key_def object > Now it is possible to work with index base object - key > definition in LUA. Available methods: > key = key_def:extract_key(tuple) > key_def:compare(tuple_a, tuple_b) > key_def:compare_with_key(tuple, key), where key is tuple or table > new_key_def = key_def:merge(second_key_def) The API mostly looks good to me. I hesitated a bit about extract_key() building a tuple, not returning a raw msgpack pointer and part count, like C api, but then I erred on the side of safety. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov