Prefix niggle: Comparators

Infix comparators are very intuitive:
x < y
Which reading literally sounds like "x is less-than y". Visually the arrow indicates we are testing for x being smaller than y.

Prefix notation for comparators has always been something hard for me to think about:
(< x y)
Reading literally sounds like "less-than x y", which takes a bit of mental untangling. Visually it requires a bit of cognition to distinguish < is less-than and > is greater-than because there is no context.

However if instead of calling < "less-than?", we call it "ascending?" then grammatically the sentence become much easier to understand: "ascending? x y". Also the arrow is more easily interpreted visually as we don't require any context to consider it to be a ramp ascending < or a ramp descending >.

No comments:

Post a Comment