Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 5/5] lua: introduce utf8 built-in globaly visible module
Date: Sat, 5 May 2018 03:18:15 +0300	[thread overview]
Message-ID: <20180505001815.2qaim6cgkya4pnx6@tkn_work_nb> (raw)
In-Reply-To: <a4bf48fb-ba0a-77e0-1459-514d73b4f2f0@tarantool.org>

Vlad,

Thanks for the fixes. You are rock!

I want to clarify two things, please see below.

WBR, Alexander Turenko.

On Sat, May 05, 2018 at 02:32:27AM +0300, Vladislav Shpilevoy wrote:
> Hello. Thanks for review.
> 
> On 05/05/2018 01:33, Alexander Turenko wrote:
> > Vlad,
> > 
> > Are you try to run tests from utf8.lua from [1]?
> > 
> > [1]: https://www.lua.org/tests/lua-5.3.4-tests.tar.gz
> > 

Are you think such testing would be redundant? I don't insist, just want
to know explicit position.

> > > +
> > > +/**
> > > + * Calculate length of a UTF8 string. Length here is symbol count.
> > > + * Works like utf8.len in Lua 5.3.
> > > + * @param String to get length.
> > > + * @param Start byte offset. Must point to the start of symbol. On
> > > + *        invalid symbol an error is returned. Can be negative.
> > 
> > Can be 1 <= |start| <= #str + 1, right? Is it worth to document? Such
> > offset equilibristics is not very intuitive (at least for me).
> 
> No, start can be any, as well as end.
> 

It does not look like so:

tarantool> print(utf8.len('abc', 0))
nil     position is out of string

tarantool> print(utf8.len('abc', 5))
nil     position is out of string

tarantool> print(utf8.len('abc', 1, 4))
nil     position is out of string

That matches lua 5.3 behaviour, but contradicts with your words above.
So the question is about proper doxygen-style comment.

> > 
> > > + * @param End byte offset, can be negative. Can point to the
> > > + *        middle of symbol.
> > 
> > We need to clarify that a symbol under the end offset is subject to
> > include into the resulting count (inclusive range).
> > 
> > I would also explicitly stated that -1 is the end byte.
> > 
> > Worth to document allowed range (0 <= |end| <= #str, right?)?
> 

  reply	other threads:[~2018-05-05  0:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28 22:45 [tarantool-patches] [PATCH v2 0/5] Expose ICU into Lua Vladislav Shpilevoy
2018-04-28 22:45 ` [tarantool-patches] [PATCH v2 1/5] alter: fix assertion in collations alter Vladislav Shpilevoy
2018-04-28 22:45 ` [tarantool-patches] [PATCH v2 2/5] Move struct on_access_denied_ctx into error.h Vladislav Shpilevoy
2018-05-04 11:06   ` [tarantool-patches] " Alexander Turenko
2018-05-04 12:05     ` Vladislav Shpilevoy
2018-04-28 22:45 ` [tarantool-patches] [PATCH v2 3/5] Merge box_error, stat and collations into core library Vladislav Shpilevoy
2018-05-04 11:36   ` [tarantool-patches] " Alexander Turenko
2018-05-04 12:05     ` Vladislav Shpilevoy
2018-05-08 13:18   ` Konstantin Osipov
2018-05-10 21:06     ` Vladislav Shpilevoy
2018-04-28 22:45 ` [tarantool-patches] [PATCH v2 4/5] Always store built-in collations in the cache Vladislav Shpilevoy
2018-05-08 13:20   ` [tarantool-patches] " Konstantin Osipov
2018-04-28 22:45 ` [tarantool-patches] [PATCH v2 5/5] lua: introduce utf8 built-in globaly visible module Vladislav Shpilevoy
2018-05-04 22:33   ` [tarantool-patches] " Alexander Turenko
2018-05-04 23:32     ` Vladislav Shpilevoy
2018-05-05  0:18       ` Alexander Turenko [this message]
2018-05-05  0:24         ` Vladislav Shpilevoy
2018-05-05  0:38           ` Alexander Turenko
2018-05-05  0:45             ` Vladislav Shpilevoy
2018-05-08 13:21   ` Konstantin Osipov
2018-05-05  0:19 ` [tarantool-patches] Re: [PATCH v2 0/5] Expose ICU into Lua Alexander Turenko

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=20180505001815.2qaim6cgkya4pnx6@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH v2 5/5] lua: introduce utf8 built-in globaly visible module' \
    /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