Y
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
DerekL
921 days ago
You can do that in modern C++, except that you have to create a lambda and assign it to a variable.
link
mrlonglong
921 days ago
That's just syntactic sugar, but yes that works and I had forgotten about lambdas.
link
fuzztester
921 days ago
Python allows nested functions too.
Can't remember about Ruby.
link