|
|
|
|
|
by dom96
4030 days ago
|
|
> and for a -b to get parsed as a(-b) It almost looks like you're suggesting that `a -b` will be parsed as a*(-b). Let me just clarify, that is not the case. With the 'strongSpaces' feature, `a -b` results in a compile-time error. Without that feature, it works as expected (`a-b`). > Nim also allows passing by non-const reference without any indication of such at the call site. Why is this a problem? > Also it has semantic indentation, which is cute and clean-looking but more effort to safely edit than the popular alternatives. Could you give an example of how exactly semantic indentation makes the language less safe? I have been using Nim (and Python) for years and have not found this to be the case. |
|
Unless there's a function named a? It doesn't matter, you're cherry-picking your response.
> Why is this a problem?
Go ahead and tell us what benefits and detriments you're already aware of, having thought about the question, and I'll tell you if you've missed anything. e: I recommend looking at why C++ has non-const reference parameters and how C# handles the problem and considering whether the benefits of this feature could be had without its detriments.
> Could you give an example of how exactly semantic indentation makes the language less safe?
I said that it was more effort to safely edit. Your question drops the specificity that we're talking about making edits to the code, and also that we're talking about an effort/safety trade-off. Also, it's specifically the kind of semantic indentation found in Python, not (to such a degree) the kind typically found in Haskell. It's easy to find examples: Almost every edit that moves code around takes higher cognitive load than the equivalent done in a language where blocks are explicitly delimited.