Re: Some questions about the array.

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: "'Pavel Stehule'" <pavel(dot)stehule(at)gmail(dot)com>, YUriy Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Some questions about the array.
Date: 2015-11-09 12:13:04
Message-ID: B6F6FD62F2624C4C9916AC0175D56D88420A168A@jenmbs01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>From: pgsql-hackers-owner(at)postgresql(dot)org [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Pavel Stehule
>Sent: Montag, 9. November 2015 12:49
>To: YUriy Zhuravlev
>Cc: PostgreSQL Hackers
>Subject: Re: [HACKERS] Some questions about the array.
>
>
>
>2015-11-09 12:36 GMT+01:00 YUriy Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru>:
>On Sunday 08 November 2015 16:49:20 you wrote:
>> I'm not necessarily objecting to that, but it's not impossible that it
>> could break something for some existing user. We can decide not to
>> care about that, though.
>
>We had an idea. You can use ~ to convert the index to the array which always
>starts with 0. Then we can use negative indexes, and you can always find the
>beginning of the array.
>Example:
>we have array [-3:3]={1,2,3,4,5,6,7}
>array[~0] == 1
>array[~-1] == 7
>array[~2:~-2] == {3,4,5,6}
>
>What do you think?

Hi,

~ is the bitwise NOT operator.
so array[~n:~m] has a current meaning. Not very useful though.
It would be better to choose another character.

my 2 pence,

Marc Mamin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-11-09 12:29:30 Re: Some questions about the array.
Previous Message YUriy Zhuravlev 2015-11-09 12:07:46 Re: Some questions about the array.