3 ms·
Minor nitpick: "(==) 0" wouldn't be syntactic sugar, but "(== 0)" is. But I agree it's a very natural consequence of the way the language is designed.
by tome 10y ago
Minor nitpick: "(==) 0" wouldn't be syntactic sugar, but "(== 0)" is. But I agree it's a very natural consequence of the way the language is designed.
- seanparsons 10y agoI'm not sure I understand, is there some special casing going on with "(== 10)"? As I'm admittedly not aware of it.
- tome 10y agoNot anything major. It's just syntactic sugar for "\x -> x == 10".
- seanparsons 10y agoHow is it syntactic sugar? It's just applying "10" to the first parameter of "==".
- deleted 10y ago[deleted]
- dllthomas 10y agoWithout parentheses, == is infix. (== 10) is an "operator section", and applies 10 to the second parameter of ==. (10 ==) would be the first parameter.
- seanparsons 10y agoAh yes, very true.