[Oberon] Multiple RETURN in a procedure

Skulski, Wojciech skulski at pas.rochester.edu
Sun Oct 23 06:04:36 CEST 2022


I know this is a recurring topic, but still... what is so sinister about multiple RETURN statements? The following Oberon procedure was elegantly coded with two RETURNs. Could you please remind me why multiple RETURNs were so wrong that they are now forbidden? What is the overwhelming benefit of disallowing multiple RETURNs, that is justifying breaking perfectly valid code? 

Please do not try to convince me that rewriting is easy. Yes, it is easy to rewrite this little piece. But I am now facing three thousand lines of my Oberon-2 library. It would be so nice if stylistic improvements were not introduced to the language, unless truly necessary. Is this one truly necessary, and why?

PROCEDURE min (x,y: INTEGER) : INTEGER;
BEGIN IF x < y THEN RETURN (x) ELSE RETURN (y) END END min;

Thanks,
Wojtek




More information about the Oberon mailing list