SQLite Forum

operator precedence docs missing, suggested clarifications below
Login
(Responding to this of 3 recent posts as it's easiest.)

> ... can't find anywhere where it says that where NOT goes.

Section 2 among the unary operators.

> Really, this is just an incremental improvement we're talking about here.

The issue as I see it is whether it really is an improvement. I think there may be room for improvement, and I know that the project head, Richard Hipp, is virtually always in favor of doc changes that clearly are improvements. But I want to avoid change that lacks a clear argument for. He and others have done the docs with much attention to clarity and correctness, and I have no personal desire to change the documentation without a rationally arguable net benefit to readers. The question is about sign rather than magnitude.

> It is a bit strange for IN to be in the top list but not BETWEEN 

It's less strange if you consider: ... WHERE expr IN (inadvertent_scalar);

And as discussed, BETWEEN does not fit the brevity-yielding presentation scheme that ordinary operator precedence charts usually adopt. In fact, to shoe-horn it in, we would have to deal with both its BETWEEN part and its AND part. The first part has the same precedence as equality-like operators, but the second part (if considered not in the BETWEEN context) has a lower precedence. I'm not sure that putting it in the chart would not require an asterisk and explanation as to how certain caveats apply. And I am not at all surprised that the doc's author elected to document it separately, avoiding the potential distraction of readers wondering about the other 29-31 operators (likely to be a more common case.)

> and second 2 is called operators not "binary and unary" operators.

I do not understand this assertion, (or if I do, it is plainly false.)

> Note, CAST/CASE/EXISTS don't need to be in list of operators because ...

Good. That would be even more of a shoe-horning task.