3 ms·
I think what op meant about importing is one of the things I don't like about Nim. If you have import os then both existsFile("test.txt") and os.exis
by Symmetry 8y ago
I think what op meant about importing is one of the things I don't like about Nim. If you have
import os
then both
existsFile("test.txt")
and
os.existsFile("test.txt")
will work whereas I prefer Python's forcing you to use the later. Nim is definitely a language for small teams where you can expect everybody to agree on sensible best practices and not get too clever.
- Tiberium 8y agoJust use `from os import nil` and you'll be only able to use that module with "os" prefix.
- Symmetry 8y agoYou can follow that convention and it works but you could also just have the convention of always using os.existsFile. Again, if you follow sensible rules when using Nim you're fine and the compiler will protect from mistakes better than most compiled languages. It's just laziness and cleverness that are dangers :)