I used to have object pascal as my main language, and it has a lot in its favour. But when I go back to it I find two things drag it down.
Pre definition of variables. I would like to be able to define variables on first assignment and scoped to the begin/end in which that happens, I don't think there is a good remaining argument to keep them above the statements.
The namespace is cluttered with legacy usage, making the many years of advancement require odd. Combinations of prefixes.
I still think there is a scope for a light fork that changes the name to distinguish it and starts the RTL afresh using the decades of hindsight and improvements.
Lerc · · focus · HN ↗
Pre definition of variables. I would like to be able to define variables on first assignment and scoped to the begin/end in which that happens, I don't think there is a good remaining argument to keep them above the statements.
The namespace is cluttered with legacy usage, making the many years of advancement require odd. Combinations of prefixes.
I still think there is a scope for a light fork that changes the name to distinguish it and starts the RTL afresh using the decades of hindsight and improvements.
cisc · · focus · HN ↗
Good news! Object Pascal has inline variable declaration with type inference:
<a href="https://docwiki.embarcadero.com/RADStudio/Florence/en/Delphi_Statements#Local_Variable_and_Constants_Declarations" rel="nofollow">https://docwiki.embarcadero.com/RADStudio/Florence/en/Delphi...
<a href="https://blogs.embarcadero.com/introducing-inline-variables-in-the-delphi-language/" rel="nofollow">https://blogs.embarcadero.com/introducing-inline-variables-i...
Lerc · · focus · HN ↗
Type inference is my preference but I thought that would have been a step too far for some.
djriley · · focus · HN ↗