2 ms·
They let you parametrize code. They aren't as powerful as macros but still have notable use-cases. A case that comes up over and over for me is when you are ge
by chipsy 16y ago
They let you parametrize code. They aren't as powerful as macros but still have notable use-cases.
A case that comes up over and over for me is when you are generating a GUI with a set of numbered list items and you want the click events to go "action(1)" "action(2)" "action(3)" with each corresponding item, you can both generate widgets and define anonymous functions for each one within a 0..3 loop. The less-appealing alternative in that case would be to dump more state info on the widgets and then run a general-purpose function to parse the widget data on the click event.