4 ms·
Yes, Nim still uses partial case insensitivity: http://nim-lang.org/manual.html#identifier-equality http://nim-lang.org/manual.html#identifier-equality I agree
by def- 11y ago
Yes, Nim still uses partial case insensitivity: http://nim-lang.org/manual.html#identifier-equality http://nim-lang.org/manual.html#identifier-equality
I agree that it's a problem with grep, there's a nimgrep tool that you could use instead, but I don't.
The nice part about it is that you can use a consitent naming convention even when using external libraries.
My idea to solve the problems this causes without removing it would be a gofmt like tool as described here: https://github.com/Araq/Nim/wiki/GSoC-2015-Ideas#nimfmt-automatically-format-nim-code https://github.com/Araq/Nim/wiki/GSoC-2015-Ideas#nimfmt-auto...
- gtaylor 11y agoIs there any way to disable this behavior? I've been curious about Nim, but this makes me cringe pretty hard. I get the intention, but this is exactly the kind of magic that I dislike.
- krupan 11y agoI haven't used go or gofmt, but I don't quite understand the appeal. gofmt doesn't go both ways, right? You can't write go in one style and then gofmt it to share, and then un-gofmt it back to your preferred style, right? Seems like it would still be easiest to just get comfortable writing and reading in the style gofmt produces. At that point, gofmt is just for catching little mistakes, which, maybe the compiler could just do for you. I see python and nim's significant whitespace as a step in that direction. Why not have the compiler/interpreter enforce a certain number of spaces for indentation? Why not enforce a certain naming style?
- kej 11y ago>Seems like it would still be easiest to just get comfortable writing and reading in the style gofmt produces. That's the entire point of gofmt. Like many of Go's design choices, it's there to subtly (or not so subtly) encourage doing things in one consistent way.
- msie 11y agoOh god, this is so horrible. I've never seen this in the many languages I've used and consider all the programmers happily using those languages without this "feature". Please kill this feature now while the language is still relatively young.
- Scramblejams 11y agoYour comment made me wonder if this feature was conceived as a red herring just to keep people from going on about significant whitespace. :-) If I ever design a language I might have to remember that.
- jessaustin 11y agoHa! Great idea. Significant whitespace is a good thing. "partial case insensitivity"? KIWF! Or at least let it be overridden via configuration flags.
- wtetzner 11y ago> The nice part about it is that you can use a consitent naming convention even when using external libraries. I think a slightly nicer (in the sense that it would catch more typos) way to do it might be to specify the naming convention at the top of the source file, and have the compiler enforce that naming convention within the file. Maybe also have a way to set it in the build system, so it could enforce it for the whole project. That way your project is consistent, but the libraries you rely on don't have to match your conventions.
- Retra 11y agoI was about to say the same thing (about enforcing the convention directly.) But there's a problem. Let's say I write a function called `HTTPHeaderScan()`. Someone else might have used `HttpHeaderScan()`. Or worse: `HtTpHeAdErScAn()`. How do you enforce one over the other? If you said "everthing must be CamelCase," how do you know that the name is wrong?
- rat87 11y agoAssuming you have a consistent naming scheme for your language I'd assume this would be mostly used to call libraries written in other languages