See [sugar.capture](https://nim-lang.org/docs/sugar.html#capture.m%2Cvarargs%5Btyped%5D%2Cuntyped). (It seems to be broken in the Nim version I'm using, but you can manually do what it does — wrap the closure in another closure that takes the values as parameters and immediately pass them to it.)
- Closures inside loops without capturing loop variable? trisub
- Closures inside loops without capturing loop variable... xigoi