You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucy.apache.org by Marvin Humphrey <ma...@rectangular.com> on 2013/09/19 04:05:00 UTC

[lucy-dev] Signed integer Unicode code points

On Thu, Sep 5, 2013 at 3:11 PM,  <nw...@apache.org> wrote:
> Initial implementation of StringIterator

> Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
> Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f7edbe56
> Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f7edbe56
> Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f7edbe56

> +#define CFISH_STRITER_DONE  UINT32_MAX

What do you think about representing Unicode code points throughout
Clownfish (and also Lucy) as int32_t rather than uint32_t?  We don't
need the whole unsigned range.

That would allow downstream users to define procedures which return negative
values to indicate whatever -- such as a find() function returning -1 to
indicate that a string wasn't found.  Or whatever.  Without having a
signed/unsigned mismatch and having to think through implications of integer
promotion.

Marvin Humphrey

Re: [lucy-dev] Signed integer Unicode code points

Posted by Nick Wellnhofer <we...@aevum.de>.
On 19/09/2013 04:05, Marvin Humphrey wrote:
> On Thu, Sep 5, 2013 at 3:11 PM,  <nw...@apache.org> wrote:
>> Initial implementation of StringIterator
>
>> Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f7edbe56
>> Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f7edbe56
>> Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f7edbe56
>
>> +#define CFISH_STRITER_DONE  UINT32_MAX
>
> What do you think about representing Unicode code points throughout
> Clownfish (and also Lucy) as int32_t rather than uint32_t?  We don't
> need the whole unsigned range.

+1

Nick