News for hackers. Stuff that matters.
Re:Pascal for Small Machines by mrlonglong on Tuesday December 12, 2023 @11:23AM (#38614286)
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++.

Re:Pascal for Small Machines by DerekL on Tuesday December 12, 2023 @12:31PM (#38615390)
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.