Am 18.06.2023 um 03:04 schrieb Hairy Pixels via fpc-pascal:

On Jun 18, 2023, at 1:07 AM, tsie...@softcon.com wrote:

This is interesting, because it's the first time I've ever seen "break" as a 
valid command in pascal, and I've been using pascal since the mid/late 80s.  All kinds of 
dialects too, and I've never seen break as a keyword.  C, Python, Perl, sure, even shell 
scripts, but pascal? Never seen it used before.  Is this a relatively new addition to fpc 
or something?
I don't remember break NOT being in Pascal. How did you exit a loop otherwise, 
goto? Break is common in basically all languages now. Can't think of a language 
I've used without it.

FWIW, when I started to work on New Stanford Pascal (http://bernd-oppolzer.de/job9.htm) in 2011, the very first thing that I did was to add BREAK, CONTINUE and RETURN to this compiler. New Stanford Pascal is an offspring of the Zürich P4 compiler from the 1970s, directly from
the working group of Niklaus Wirth (who was at Stanford, too, BTW).

The compiler is a self-hosting compiler (like most Pascal compilers, I believe) and up to 2011 there were many exits from loops bye putting a label after the loop and using GOTO (because of the absence of BREAK). Similar use of GOTO to implement CONTINUE and RETURN.

I got rid of most of these labels (if not all) by adding these three keywords. This was easy. I did many extensions to the compiler later (from 2016 on) and ported the compiler to Windows and Linux etc.; the compiler, which had 6.000 lines in 2011, now has over 25.000 lines :-)

Kind regards

Bernd

Regards,
        Ryan Joseph
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to