Please don't get wrong about my intentions. If there's any point I want to
make, it's about my ignorence.
I simply started with the link mentioned by moigagoo and the explanation in the
first chapter _Nim in Action_, did some experiments, found some behaviour that
didn't seem to be described by those texts, and tried to find more patterns in
what I had observed. This is not a straightforward process. Hence the somewhat
unorganized abundance of 12+ rules. I don't want to fight for them, quite the
contrary, I want them to be reduced to a clear and compact system where nothing
can be taken out of without loosing completeness. Any help with that is
appreciated.
In spite of the grammar rule that Araq has mentioned, which reveals a lot more
about the underlying mechanisms indeed, I don't think we are at that stage of
completeness yet, speaking about documentation. I still fail to understand why
`{`}!___!{`}` or `{`}___{`}` is 3 times a valid `_` token (collapsing to
`{`}!!{`}` or `{`}_{`}` respectively), and `{`}echo___echo{`}` is not, for
instance. I've no idea why `x_–y`, `x––y` and `–xy` are good, and `x–_y`,
`x__y` and `_xy` are bad, whithout adding more rules than I have read so far in
the documentation (the dash-like symbols here are en-dashes). Yes, these are
edge cases, and probably of no practical value in daily affairs. But what's
wrong about that in the context of understanding a language's design?
@moigagoo: Conventions and restrictions are two different things. I was just
aiming at the restrictions (or to put it otherwise: degrees of freedom) for
now. Some Nim conventions can be found
[here](https://github.com/nim-lang/Nim/wiki/Style-Guide-for-Nim-Code). I've
read them and I do know conventions are a subset of restrictions. If I have
used some confusing terms in this thread, I apologize for that.
@Araq: Are naming rules a good starting point for learning a new language? In
this case, I'm inclined to think not. I've noticed the structure of Nim is
reflected in the naming to some extent. I can see the beauty of that, but it's
also a complication in mastering (and documenting) Nim. Maybe I should study
Nim for a year or so before trying to really understand the production rules
for names.