News for hackers. Stuff that matters.
Re:The Oberon+ Programming Language by ZoomZoomZoom on Saturday March 18, 2023 @12:12PM (#35210266)
My Pascal days are far in the past, but I recently used Lazarus to quickly prototype a simple GUI app (not many tools beat it yet for the task) and was a bit annoyed by the syntax.

Relying on expressions greatly reduces the need for transitory variables, and in case of Pascal, where you can't just declare them as you go, this would be especially important to clear the code from ops inessential to the task at hand.

`let foo = if (bar > 0) then bar else frobnicate() end` would be nice to have, as well as begin-end blocks with their own scope (can't fathom the reasons it's not allowed) and evaluated to the last statement. Rust and Nim get it mostly right.

Re:The Oberon+ Programming Language by shadowofneptune on Saturday March 18, 2023 @12:34PM (#35210507)
This does feel then like a matter of taste. While Pascal's predecessor language Algol did allow syntax like that, adding it back to Pascal-like languages would make it into a different kind of language.
Re:The Oberon+ Programming Language by ZoomZoomZoom on Saturday March 18, 2023 @12:47PM (#35210651)
What makes the language what it is is rather a philosophical question. I don't think I agree with you on this specific point.

I'm not against evolution, especially when you have others to test the feature extensively for years. But I'm not a language designer and my opinion on the matter holds no weight.

Re:The Oberon+ Programming Language by neutrono on Saturday March 18, 2023 @08:06PM (#35214520)
Ada 2012 has expression functions

    declare
        function f (i: Integer) returns Integer is ( i * 2 );
         x : Integer;
    begin
        x := f(21);
    end;