3 ms·
4. The fact that operator order is changed by the amount of white space between symbols 2+2 * 5 = 20 2 + 2 * 5 = 12
by valarauca1 10y ago
4. The fact that operator order is changed by the amount of white space between symbols
2+2 * 5 = 20
2 + 2 * 5 = 12
- adrusi 10y agoIf you're consistent about how you space your infix operators, this will have no impact on your code. If you put space around some operators and not around others, in a way that doesn't correspond to precedence, you're going to confuse anyone who reads your code, in any language.
- valarauca1 10y agoBeing confused by code is no excuse for code not doing what ya know... every other programming language has done for the past 50 years. I get that trying new things, but somethings are pretty well agreed upon.
- xutopia 10y agodamn... I actually like that a lot!
- qu4z-2 10y agoI like it for distinguishing homonym operators, but not for the precedence stuff they seem to have there. I'd like something like this though: let a = 10; a / 5 output> 2 let b = pwd(); b/temp output> Directory<"~/temp"> b / 2 error> b:Directory does not implement method "divide(:number)" a/temp error> a:int does not implement method "get(:string)"
- progman 10y agoI am a strong proponent of Nim but this is probably the worst idea I have ever encountered in language development. Honestly! Partial case sensitivity and the special underscore case are features I can live with. Unfortunately this has actually become a stumbling block for a wider adoption of Nim. All strange special features should be optional, not default.
- dom96 10y agoWhat makes you think this is default? It most certainly is not and will be removed completely in the future. Edit: here is a source: http://nim-lang.org/docs/manual.html#syntax-strong-spaces http://nim-lang.org/docs/manual.html#syntax-strong-spaces ("... if the experimental parser directive #?strongSpaces is used..."). The last time this was discussed I said that it would be removed completely, and I still believe it will be. It's simply not a priority for us right now.
- progman 10y ago> What makes you think this is default? Some of those features are default in Nim, some (strongspaces) are not. I say that all such weird features should be optional in general so that newcomers don't get scared off. Also case and underscore should work like in C per default since Nim interoperates with C seamlessly anyway. Case insensitivity and ignoring underscore are ok if optional.