Hacker News new | ask | show | jobs
by mrlonglong 921 days ago
What I liked the most about Pascal was the ability to have nested functions or procedures to keep things local to a large function or a large procedure.

Visual Basic lets me do the same. Can't do that with C/C++.

2 comments

You can do that in modern C++, except that you have to create a lambda and assign it to a variable.
That's just syntactic sugar, but yes that works and I had forgotten about lambdas.
Python allows nested functions too.

Can't remember about Ruby.