Re: [sqlite] XOR operator

2018-04-27 Thread fredericDelaporte
R Smith wrote > it would be nice to have > an XOR operator in the way that & and | work...  Is there any character > left to use, or one that are regularly used as XOR in other languages?  > The $ sign seems to be free, but it would be nice to conform to some > standard. Perhaps a combined

Re: [sqlite] XOR operator

2017-10-09 Thread Kees Nuyt
On Mon, 9 Oct 2017 13:35:28 +0200, R Smith wrote: >On 2017/10/09 3:07 AM, Richard Hipp wrote: >> Then you want: a = ~b > > Wow, I missed this, and it works already.  Thank you kindly! > > May I suggest adding a small section to the binary/unary operators in > the

Re: [sqlite] XOR operator

2017-10-09 Thread R Smith
On 2017/10/09 3:07 AM, Richard Hipp wrote: Then you want: a = ~b Wow, I missed this, and it works already.  Thank you kindly! May I suggest adding a small section to the binary/unary operators in the documentation that names each operator and provide a short function description (at least

Re: [sqlite] XOR operator

2017-10-08 Thread Richard Hipp
On 10/8/17, R Smith wrote: > On 2017/10/06 6:03 PM, Richard Hipp wrote: >> On 10/6/17, R Smith wrote: >>> I'd also like to see a Unary NOT operator, such that you can say: a = !b >> In SQL and SQLite that would be: a = NOT b > > Apologies, I thought it

Re: [sqlite] XOR operator

2017-10-08 Thread Simon Slavin
On 9 Oct 2017, at 12:06am, R Smith wrote: > The topic started as a request for an XOR operator. I've added a request for > a NOT operator. SQLite does not have a byte type. SQLite does not have any fixed-length integer type. Given those two statements, what should NOT 1100

Re: [sqlite] XOR operator

2017-10-08 Thread R Smith
On 2017/10/08 11:30 PM, Keith Medcalf wrote: If for example a = 0xA then !a might be 0x5 for a nibble, but it will be 0xF5 for a byte, 0xFFF5 for a WORD, 0xFF5 for a 32bit INT, etc. etc. This is balderdash. There is no such thing as "meant", only "is". And you last sentence is

Re: [sqlite] XOR operator

2017-10-08 Thread Keith Medcalf
ays a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Peter Da Silva >Sent: Sunday, 8 October, 2017 08:40 >To: SQLite mailing list >Subject: Re: [sqlite] XOR operator >

Re: [sqlite] XOR operator

2017-10-08 Thread Keith Medcalf
rogrammer rather than a $3.99/hour coder). --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of R Smith

Re: [sqlite] XOR operator

2017-10-08 Thread Keith Medcalf
Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of R Smith >Sent: Sunday, 8 October, 2017 07:38 >To: sqlite-users@mailinglists.sqlite.org >Subject: Re: [sqlite] XOR operator > >On 2017/10/06 6:03 PM, Richard Hipp wrote: &g

Re: [sqlite] XOR operator

2017-10-08 Thread Clemens Ladisch
R Smith wrote: > I meant a binary operation, not a Boolean operation NOT. "NOT X" = "-X - 1" > Answering (2): A strongly typed language that defines INT/UINT/WORD/ > INT64/etc. as specifically a 32-bit or 64-bit signed/unsigned > representation, or "Byte" as a 8-bit unsigned representation will

Re: [sqlite] XOR operator

2017-10-08 Thread Simon Slavin
On 8 Oct 2017, at 3:55pm, R Smith wrote: > SQLite's typing system is great, but you can't tell me for certain the > predicted size of a column of integers. Some will take less bits than others, > based on the value of the actual Integer. Inside functions SQlite will try >

Re: [sqlite] XOR operator

2017-10-08 Thread R Smith
On 2017/10/08 3:56 PM, Roman Fleysher wrote: The point is that terminology is chosen for a reason and can not be dismissed. "Flexibly typed" means it is typed. It means SQLite knows how many bytes: without knowing it would not be able to establish equality "IS". Flexibly means columns can

Re: [sqlite] XOR operator

2017-10-08 Thread Peter Da Silva
. > > Roman > > > > > Original message ---- > From: R Smith <rsm...@rsweb.co.za> > Date: 10/8/17 9:38 AM (GMT-05:00) > To: sqlite-users@mailinglists.sqlite.org > Subject: Re: [sqlite] XOR operator > > On 2017/10/06 6:03 PM, Ric

Re: [sqlite] XOR operator

2017-10-08 Thread Roman Fleysher
From: R Smith <rsm...@rsweb.co.za> Date: 10/8/17 9:38 AM (GMT-05:00) To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] XOR operator On 2017/10/06 6:03 PM, Richard Hipp wrote: > On 10/6/17, R Smith <rsm...@rsweb.co.za> wrote: >> I'd also like to see a Unary NOT

Re: [sqlite] XOR operator

2017-10-08 Thread R Smith
On 2017/10/06 6:03 PM, Richard Hipp wrote: On 10/6/17, R Smith wrote: I'd also like to see a Unary NOT operator, such that you can say: a = !b In SQL and SQLite that would be: a = NOT b Apologies, I thought it obvious from the context that I meant a binary operation,

Re: [sqlite] XOR operator

2017-10-06 Thread Jens Alfke
> On Oct 6, 2017, at 9:25 AM, Alex Henrie wrote: > > Still, it would be a little nicer if I > could write a == b XOR c == d instead of (a == b) != (c == d). You can easily implement an “xor(a, b)” function in C. It’s maybe 20 lines of code including registering it.

Re: [sqlite] XOR operator

2017-10-06 Thread Alex Henrie
2017-10-06 1:28 GMT-06:00 Clemens Ladisch : > Alex Henrie wrote: >> I wanted to use the XOR operator in a query today, but then found out >> that SQLite doesn't support it. > > For boolean values, "a XOR b" = "a <> b". > For binary values, "a XOR b" = "(a | b) - (a & b)".

Re: [sqlite] XOR operator

2017-10-06 Thread Richard Hipp
On 10/6/17, R Smith wrote: > I'd also like to see a Unary NOT operator, such that you can say: a = !b In SQL and SQLite that would be: a = NOT b > But, I guess that's only feasible in a strongly typed language. (1) I object to the characterization of SQLite not being

Re: [sqlite] XOR operator

2017-10-06 Thread R Smith
On 2017/10/06 11:31 AM, Simon Slavin wrote: On 6 Oct 2017, at 9:12am, Rowan Worth wrote: On 6 October 2017 at 15:42, wrote: On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: For boolean values, "a XOR b" = "a <> b". Is the <> operator documented

Re: [sqlite] XOR operator

2017-10-06 Thread Darko Volaric
> However, '&' and '|' and '<<' and '>>' do not seem to be defined, either > there or in Almost none of the operators are defined. All that section needs is a sentence at the start saying "The operators have the same meaning as ANSI C except as described below." > On Oct 6, 2017, at 11:31

Re: [sqlite] XOR operator

2017-10-06 Thread Andy Ling
On 6 Oct 2017, at 9:12am, Rowan Worth wrote: > On 6 October 2017 at 15:42, wrote: > >> On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: >>> >>> For boolean values, "a XOR b" = "a <> b". >> >> Is the <> operator documented somewhere? I can't find it

Re: [sqlite] XOR operator

2017-10-06 Thread Simon Slavin
On 6 Oct 2017, at 9:12am, Rowan Worth wrote: > On 6 October 2017 at 15:42, wrote: > >> On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: >>> >>> For boolean values, "a XOR b" = "a <> b". >> >> Is the <> operator documented somewhere? I can't

Re: [sqlite] XOR operator

2017-10-06 Thread Rowan Worth
On 6 October 2017 at 15:42, wrote: > On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: > > > > For boolean values, "a XOR b" = "a <> b". > > Is the <> operator documented somewhere? I can't find it in either of > these places: > <> is SQL for "not equal to" (shout

Re: [sqlite] XOR operator

2017-10-06 Thread nomad
On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: > > For boolean values, "a XOR b" = "a <> b". Is the <> operator documented somewhere? I can't find it in either of these places: https://sqlite.org/search?s=d=%3C%3E https://sqlite.org/datatype3.html#comparison_expressions

Re: [sqlite] XOR operator

2017-10-06 Thread Clemens Ladisch
Alex Henrie wrote: > I wanted to use the XOR operator in a query today, but then found out > that SQLite doesn't support it. For boolean values, "a XOR b" = "a <> b". For binary values, "a XOR b" = "(a | b) - (a & b)". Regards, Clemens ___