Closed glyn closed 1 year 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.)
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.
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 >
...
Actually, on the symmetry point, we were comfortable defining !=
in terms of ==
and that was asymmetric.
<
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.
Applying editorial discretion here. Merging.
Fixes https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/249