Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>,
	tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] [PATCH v2 4/8] lua: rework luaL_field types to support msgpack extensions
Date: Tue, 13 Aug 2019 16:15:52 +0300	[thread overview]
Message-ID: <BD594175-C3DC-4F7D-A32D-1559B106A651@tarantool.org> (raw)
In-Reply-To: <20190812212329.GF32337@atlas>


> 13 авг. 2019 г., в 0:23, Konstantin Osipov <kostja@tarantool.org> написал(а):
> 
> * Serge Petrenko <sergepetrenko@tarantool.org> [19/08/08 15:01]:
> 
>> We are planning to add new types, such as decimal, which will all
>> share a single msgpack type - MP_EXT. MP_EXT is currently treated as
>> uninterpretable in encoders. So, in order to distinguish such new types
>> introduce MP_FIELD_* instead of MP_* types for use in luaL_field
>> structure and msgpack encoders.
>> New MP_FIELD_* types will correspond to MP_* types, MP_FIELD_UNKNOWN
>> will serve the same purpose, as MP_EXT does now, and various MP_FIELD_*
>> types will correspond to various MP_EXT subtypes, such as MP_DECIMAL in
>> future.
> 
> uhg, so there is enum field_type, there is enum mp_type, and these
> are not enough, let's have a yet another enum...
> 
> Sounds like you should be able to get by with enum field_type and
> enum mp_type, no?
> 

Sorry for the confusion. I guess mp_field_type is just a bad name.
It has nothing to do with enum field_type. It just represents all the
messagepack types, including the extension types.
It helps to eliminate a switch for extension type every time we get an
MP_EXT. So, it only deals with mp_type and mp_user_type.

> Look at mp_type when you can, and when you get MP_EXT or is
> otherwise confused, look at field_type?

That’s what I’ve done in previous revision, but Vladimir didn’t like it.
And having implemented both variants, I agree that this enum simplifies
the code quite a lot. This is especially noticeable with patch 6.

So, my proposal is to change the name to something better.
value_type? mp_value_type maybe?

> 
> -- 
> Konstantin Osipov, Moscow, Russia
> 

--
Serge Petrenko
sergepetrenko@tarantool.org

  reply	other threads:[~2019-08-13 13:15 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 11:55 [PATCH v2 0/8] Decimal indices Serge Petrenko
2019-08-08 11:55 ` [PATCH v2 1/8] lua: fix decimal comparison with nil Serge Petrenko
2019-08-12 21:16   ` Konstantin Osipov
2019-08-14 11:00   ` Vladimir Davydov
2019-08-14 22:17     ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 2/8] decimal: fix encoding numbers with positive exponent Serge Petrenko
2019-08-12 21:18   ` Konstantin Osipov
2019-08-13  9:00     ` [tarantool-patches] " Serge Petrenko
2019-08-14 22:21       ` Konstantin Osipov
2019-08-14 11:56   ` Vladimir Davydov
2019-08-08 11:55 ` [PATCH v2 3/8] lua/pickle: fix a typo Serge Petrenko
2019-08-12 21:18   ` Konstantin Osipov
2019-08-14 11:12   ` Vladimir Davydov
2019-08-14 11:15     ` Serge Petrenko
2019-08-08 11:55 ` [PATCH v2 4/8] lua: rework luaL_field types to support msgpack extensions Serge Petrenko
2019-08-12 21:23   ` Konstantin Osipov
2019-08-13 13:15     ` Serge Petrenko [this message]
2019-08-14 22:23       ` [tarantool-patches] " Konstantin Osipov
2019-08-15  8:27         ` Serge Petrenko
2019-08-16  8:06           ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 5/8] box: rework field_def and tuple_compare to work with mp_field_type instead of mp_type Serge Petrenko
2019-08-12 21:28   ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack Serge Petrenko
2019-08-12 21:29   ` Konstantin Osipov
2019-08-12 21:34   ` Konstantin Osipov
2019-08-13 14:01     ` Serge Petrenko
2019-08-14 22:25       ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 7/8] decimal: add conversions to (u)int64_t Serge Petrenko
2019-08-12 21:39   ` Konstantin Osipov
2019-08-13 14:18     ` Serge Petrenko
2019-08-14 22:26       ` Konstantin Osipov
2019-08-14 22:29         ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 8/8] decimal: allow to index decimals Serge Petrenko
2019-08-08 13:42   ` Serge Petrenko
2019-08-12 21:41   ` Konstantin Osipov

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=BD594175-C3DC-4F7D-A32D-1559B106A651@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] [PATCH v2 4/8] lua: rework luaL_field types to support msgpack extensions' \
    /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