Could you provide an MWE (minimal **_working_** example) of your issue?
On a related note, I like the C++ approach to lambdas, which is based on a struct with an overloaded function call method, and makes explicit whether or not variables are captured, and whether they're mutated. IIRC Nim can do something similar as an experimental feature, that is, make objects callable. I wonder if anyone uses this feature?