ietf-wg-jsonpath / draft-ietf-jsonpath-base

Development of a JSONPath internet draft
https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/
Other
59 stars 20 forks source link

Define > in terms of < #257

Closed glyn closed 1 year ago

glyn commented 2 years ago

Fixes https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/249

glyn commented 2 years ago

Thanks for your comments @timbray and @gregsdennis. I feel I should explain. The current draft defines the orderings < and > using the same text. For strings, the text talks about "less than" but not "greater than". So the current text implicitly assumes that for strings a and b, a > b if and only if b < a. Non-mathematicians would tend to say this is patently obvious. But this PR avoids that assumption by only defining < using the same text and then defining > in terms of <.

However, I take the point about the standalone definitions and the arbitrariness of defining one in terms of the other.

So my question is: is the current draft text sufficiently precise? If not, I'll rework this PR to make it more precise. (When I started out doing that, it began to get quite wordy, so I changed tack.)

goessner commented 2 years ago

Despite the fact, that Glyn's approach is mathematically clean, I would favour the symmetric approach by defining ==, >,<.

I am quite sure, that nobody will cry "redundancy" then.

cabo commented 2 years ago

Defining one in terms of the other means you have to make an arbitrary choice of which is directly defined and which is indirectly defined.

Yes. Is that a problem? < comes before >...

glyn commented 2 years ago

Actually, on the symmetry point, we were comfortable defining != in terms of == and that was asymmetric.

gregsdennis commented 2 years ago

< comes before >

In what system of mathematics are operations ordered? This is completely arbitrary.

I'm not convinced this needs to change. I prefer defining both < and >.

And for symmetry, I'd change strings to match.

glyn commented 1 year ago

Applying editorial discretion here. Merging.