News for hackers. Stuff that matters.
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.
Re:Nim Apocrypha, Vol. I by mhh__ on Wednesday December 23, 2020 @06:53AM (#25516666)
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.

Re:Nim Apocrypha, Vol. I by cb321 on Wednesday December 23, 2020 @07:23AM (#25516815)
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...