4 ms·
This was a joke right?
by lamp987 4y ago
This was a joke right?
- philosopher1234 4y agoNo I’m being sincere. Clarity is more important than performance. This is a very thoughtful decision, it relieves devs of the idiotic pressure to micro optimize.
- frou_dh 4y agoIt's amusing to mention clarity, given the topic. Because the cargo-cult of this kind of function having return type 'int' is lack of clear thinking manifest. Int has 4-billion distinct values and all they want is three. Here's clarity: datatype order https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.order:TY https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.o... function compare https://smlfamily.github.io/Basis/string.html#SIG:STRING.compare:VAL https://smlfamily.github.io/Basis/string.html#SIG:STRING.com... case String.compare(a, b) of | LESS => ... | EQUAL => ... | GREATER => ...