Re:Nim Apocrypha, Vol. I
by planetis on Wednesday December 23, 2020 @05:21AM
(#25516222)
We have like 5 different `with` macros including one in stdlib.
[ Parent
| on HN ]
I assume "We"=Nim?
It's an interesting pattern to test language designs with. On the one hand expressive macros can be disastrous in big codebases, on the other hand a more "monadic" (implemented via passing some kind of object through a chain rather than algebraically) way is very template-intensive.
At least one (very bottom of [1]) of the 5+ variants makes you list which fields the code gets access to (in a tiny 6 line Nim macro). That is an alternate, perhaps more keystroke-heavy solution to the problem bothering @simias.
[1] https://github.com/c-blake/cligen/blob/master/cligen/macUt.n...