|
|
|
|
|
by benjamin-lee
1648 days ago
|
|
There is some logic as to why that is. Here [1] is an explanation for why it makes sense but the tldr is that you don't want to be manually importing functions such as `$` and `+`. In languages like Python, those are defined as methods on the object being imported (e.g. `.__str__()`) so they come along for free. Not so in Nim. If there's a conflict (same name, same signature), the compiler will warn you but it's extremely rare. [1] https://narimiran.github.io/2019/07/01/nim-import.html |
|
I can do `mypackage.mymethod` but it will only be in my own code, because it's not the convention