From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 96DD16EC40; Tue, 17 Aug 2021 10:58:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 96DD16EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629187139; bh=PEFPCNrowgaIcufOA0PaNr8QfIkUibAKSfnUyDf8qKY=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=YbHq/QMLsKhOkVw0KGGw0+oLH/uQPyzviTrCvr6GFrsc5B6JqZ42k+6EGTCgM0RWt J25tfhBQR7bBu2IcwIdgpHYfKJqsR019HLSMBdWvjlQxubcPtgO+C8TnIteU0vcaBa gGIwjhq4CxViG8srSHOzb421LrXo+NaMpZbDfhh0= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A4B016EC40 for ; Tue, 17 Aug 2021 10:58:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A4B016EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mFtzt-0003lV-Kw; Tue, 17 Aug 2021 10:58:58 +0300 Date: Tue, 17 Aug 2021 10:58:56 +0300 To: Yaroslav Dynnikov Cc: tml , Vladislav Shpilevoy Message-ID: <20210817075856.xkelwdonp5kmdofs@esperanza> References: <02d9fe40f3b007f351d873e9cc880e41d8cfacad.1628859463.git.vdavydov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD91BCCB18F2C129F87F36E61E9E4584E9D182A05F53808504063033F9500014040C1C340B26794345AACD0AD559D468095B233F10E69C14CAB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73C871DD2182510D5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DA223B75F41C64628638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8F0D3412AFADD25486D84B49F83116D78117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A579060DF9EDF6B17082817DD2829120B394DFD1DF1A87957DD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7567C209D01CC1E34B410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34CAFBC0A7A4BEEE01393E15D3401DA06CB306616897EC51816F3A9CE6597CF0CD0E19A789F8398CC81D7E09C32AA3244C1384623066956F6F4264766F70090479E8FBBEFAE1C4874C927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojIrFL/N5KnVE+/p2Jsy44Hw== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DCDE19A860875DF3EE41D3548C3BA0AB9274CEFED1673C562683ABF942079399BFB559BB5D741EB966A65DFF43FF7BE03240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] net.box: add __serialize and __tostring methods for future objects X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladimir Davydov via Tarantool-patches Reply-To: Vladimir Davydov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Fri, Aug 13, 2021 at 08:41:28PM +0300, Yaroslav Dynnikov wrote: > On Fri, 13 Aug 2021 at 15:58, Vladimir Davydov > wrote: > > > Example output (for more examples see the test output): > > > > tarantool> f = c:eval('return 123', {}, {is_async = true}) > > --- > > ... > > > > tarantool> tostring(f) > > --- > > - 'net.box.request: 7' > > ... > > > > I think sync has no sense here. It's useless without other info (peer, > function). > Also, it complicates the tests and makes them less reliable. > IMHO simple 'net.box.request' is enough. Agree. > > > > tarantool> f > > --- > > - method: eval > > on_push_ctx: [] > > result: [123] > > on_push: 'function: builtin#91' > > sync: 7 > > ... > > > > This is also weird: > > tarantool> f > --- > - on_push_ctx: [] > method: call > sync: 4 > on_push: 'function: builtin#91' > ... > > tarantool> f.sync > --- > - null > ... > > tarantool> f.method > --- > - null > ... > > Why displaying inaccessible fields? You leave a developer no choice: > > tarantool> debug.getmetatable(f).__serialize(f).method > --- > - call > ... > > Of course, I miss that fields, but please, there should be another way to > access them. > > Also, speaking of > https://github.com/tarantool/tarantool/commit/b996502b403c1698c4b0886de636faa0a63cfb70 > , > which of them are you going to merge first? Whichever it is, I guess the > second one is destined to be refactored afterward. Reworked the patch. Now __serialize returns user-defined fields if there are any. If there's no fields, it falls back on __tostring. Will send v2 in reply to this email. Please take a look.