Nim
Nim copied to clipboard
`import` now works at local scope
links
- see tests
- see RFC: fixes https://github.com/nim-lang/RFCs/issues/410
- https://www.pythoninsight.com/2018/09/why-doesnt-import-work-at-function-scope/
there’s an exception for “from ... import *“, which can’t be used inside a function
Why not just allow general imports at local scope?
Why not just allow general imports at local scope?
done
This would be very useful! Does this require an RFC? I don't think it is controversial, but still.
This would be very useful! Does this require an RFC? I don't think it is controversial, but still.
see https://github.com/nim-lang/RFCs/issues/410
and yes, this is very useful.
Add a line explaining that import
is scoped in the Manual near
https://nim-lang.github.io/Nim/manual.html#modules-import-statement
Add a line explaining that import is scoped in the Manual near
done, i added a section
This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.