[Oberon] Multiple RETURN in a procedure

Skulski, Wojciech skulski at pas.rochester.edu
Mon Oct 24 00:53:46 CEST 2022


Chris:

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

>FTR, your original code would have been smaller and more efficient if you had used Oberon's built-in MIN function instead of writing your own.

Actually, the min function in my code takes and returns objects. So I did not use the built-in. I simplified the example to INTEGER to make the point. 

Wojtek


More information about the Oberon mailing list