Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Olga Arkhangelskaia <arkholga@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v5] build: introduce LUAJIT_ENABLE_PAIRSMM flag
Date: Tue, 26 Nov 2019 17:55:37 +0300	[thread overview]
Message-ID: <20191126145537.GB2472@uranus> (raw)
In-Reply-To: <20191126144837.78132-1-arkholga@tarantool.org>

On Tue, Nov 26, 2019 at 05:48:37PM +0300, Olga Arkhangelskaia wrote:
...
> +
> +-- There is no Lua way to detect whether LJ_PAIRSMM is enabled. However, in
> +-- tarantool build it's enabled by default. So the test scenario is following:
> +-- while we can overload the pairs/ipairs behaviour via metamethod as designed
> +-- in Lua 5.2, os.execute still preserves the Lua 5.1 interface.
> +
> +local mt = {
> +	__pairs = function(self)
> +            local function stateless_iter(tbl, k)
> +                local v
> +                k, v = next(tbl, k)
> +                while k and v > 0 do k, v = next(tbl, k) end
> +                if v then return k,v end
> +            end

Olga, could you please fix indentation. AFAIU we tend to use
4-space tabs for lua code. Don't we? Same applies to the
code below which I've just stripped out to be short.

  reply	other threads:[~2019-11-26 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 14:48 Olga Arkhangelskaia
2019-11-26 14:55 ` Cyrill Gorcunov [this message]
2019-11-26 15:14 ` Igor Munkin
2019-11-26 20:54 ` Konstantin Osipov
2020-02-19  7:49 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126145537.GB2472@uranus \
    --to=gorcunov@gmail.com \
    --cc=arkholga@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v5] build: introduce LUAJIT_ENABLE_PAIRSMM flag' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox