That was a pretty strange decision by nim to not have the import nil behaviour by default, if you are inporting a bunch of modules, readers have no idea where the functions are coming from. I just dont think many people are going to want that behaviour coming from the likes of python and c++, ie the type of people who would be interested in nim. Python has it correct I think with from module import x, y, z, or just import module as...
@andreasrumpf9012
3 жыл бұрын
Without IDE support you never know "where things are coming from" in Python or C++ either.
@Wyklepheph
3 жыл бұрын
You can do "from module import whatever" in Nim. But you really don't usually need to worry about it unless the functions operate on the same types. Nim has procedure overloading so if the procedure has the same name and requires different types as input parameters then nim will call the appropriate procedure. And I actually used python for like 95% of my projects and I haven't really touched python at all since I started using Nim. The difference in import statements is inconsequential, and when you factor in the benefits of Nim it's not an issue at all. You learn how to do it and that's that, no need to make much more of it.
Пікірлер: 4