Understanding issorted's lt keyword

I’m fine with this being better documented, and not changed.

But I must say I am a bit baffled that it’s apparently so hard to see why the current behaviour is surprising. Understanding the current behaviour requires an extremely high level of mathematical sophistication. If you are capable of that then it makes sense (I presume, I’m only a Msc in mathematics, I don’t think this is within my intellectual reach), and I don’t mind that Julia normally chooses ‘correctness’ over intuition.

But after this many posts, it’s really strange that there is apparently zero understanding among some, such as @goretkin, that this

jl> issorted([1,2,2,3]; lt=<=)
false

jl> issorted([1,2,2,3]; lt=<)
true

is surprising and weird for people below the PhD level. It may be correct, but it is strange.

What all of this has to do with which is more ‘fundamental’ of isless or < is, unfortunately, also beyond me. It’s fine that isless is the default, because it’s more fundamental, but that alone doesn’t explain why <= cannot also be used.

1 Like