I've learned a bit more since then (now also on last chapter of Nim in Action. 
Templates and Macros are also starting to make more sense).

Also a bit of a better idea of the fine line between where metaprogramming vs 
actual compiler internals lie, where you can and can't cross the two.

Probably you'd need to make a nim compiler plugin (this is how "locals()" is 
implemented). I think this concept is similar to rust's "syntax extensions".

Relevant previous forum thread on the subject (it's not really documented 
anywhere that I can see as a type of Nim metaprogramming):

[https://forum.nim-lang.org/t/1220](https://forum.nim-lang.org/t/1220)

So for instance, it's 
_[probably](https://forum.nim-lang.org/postActivity.xml#probably) possible to 
crossreference this:

compiler/plugins/locals.nim

Alongside the nimsuggest source code (included in Nim github repo)

And add something like these new plugins, to get something a bit more pythonish:

compiler/plugins/globals.nim compiler/plugins/dir.nim

Reply via email to