I work at a place which uses a lot of tcl for scripting. Tcl is a language no one knows or cares about, for good reason (except python supports tkinter graphics, which use Tk, which is tcl).
A recent version of tcl decided to be all hip and add some functional programming concepts like a map function for lists, named lmap.
Except there's no lambdas.
So you just pass map a blob of code, and it executes it in a for loop in *your* stack frame.
Soo if you call map in your function foo, the little lambda has full access to foo's locals. Just for shits and giggles.
And why would you have a "filter" function when you have map? Just put a 'continue' in the body of your "lambda" and it'll skip that list value. Put a 'break' and it will stop the map.
And if you put a 'return' in your lambda, innocently, well, the calling function will return. That's right you can return from foo while inside a call to map.
And no one complains because tcl just never respects stack frames it pulls this sort of shit all over the place.
For bonus points, "return" actually takes multiple arguments: you can tell it how many stack frames up you want to jump.















