4 ms·
Sounds like a great use case for closures https://en.wikipedia.org/wiki/Closure_(computer_programming) https://en.wikipedia.org/wiki/Closure_(computer_programm
by creatonez 4y ago
Sounds like a great use case for closures
https://en.wikipedia.org/wiki/Closure_(computer_programming) https://en.wikipedia.org/wiki/Closure_(computer_programming)
- DeathArrow 4y agoHow? You use the closure to capture the variables, but how can you make the variables visible in another function?
- kgeist 4y agoYes, this kind of approach is equivalent to closures/currying, in the style of OOP. However, using closures for this may not look idiomatic in some languages.