timotheecour / Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
http://nim-lang.org/
Other
2 stars 0 forks source link

`{.stdStrict.}`: requires `import std/macros` instead of `import macros` (etc) where the pragma applies #754

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

this helps avoid scope pollution while avoiding breaking change, as the {.stdStrict.} only applies at module/package scope

juancarlospaco commented 3 years ago

I agree!, but can this be part of the existing flags?, like --styleCheck, the way it is currently it is kinda a "style" thing anyway.

timotheecour commented 3 years ago

conflation is the mother of all bugs ;-) that'd prevent using --stylecheck for a project that uses macros (ie, lots of projects) each feature should ideally have it's own independent flag, but it's ok to have in addition meta-flags that control more than 1 feature.

just look at the mess with strictfuncs where an existing feature (func) was extended with a different meaning, preventing using func in places that would deserve it just because it now would conflate with strictfuncs.

Back to this feature though; the question is how exactly would it work; ideally this could be controllable at both a nimble-project level and a module-level so that a project can migrate gradually and still use 3rd-party tools that use import macros