You can do that in modern C++, except that you have to create a lambda and assign it to a variable.
Re:Pascal for Small Machines
by mrlonglong on Tuesday December 12, 2023 @06:42PM
(#38620448)
That's just syntactic sugar, but yes that works and I had forgotten about lambdas.
Re:Pascal for Small Machines
by fuzztester on Tuesday December 12, 2023 @03:02PM
(#38617614)
Python allows nested functions too.
Can't remember about Ruby.
Visual Basic lets me do the same. Can't do that with C/C++.