Can be achieved with lambdas or anonymous functions in most languages; c#, c++, javascript, python to name a few :)
Re:John Carmack on Inlined Code
by thomasahle on Wednesday October 01, 2014 @02:59PM
(#8396879)
Sure, but then you'd have to put the declaration before the function call.
Personally I'd like to see something like Haskell's "where", to create a scope for private functions in the "B style":
Until that becomes possible, we can always just make sufficiently small modules with few public functions.