[Oberon] Multiple RETURN in a procedure

Chris Burrows cfbsoftware at gmail.com
Mon Oct 24 01:47:42 CEST 2022


On Mon, Oct 24, 2022 at 9:24 AM Skulski, Wojciech <skulski at pas.rochester.edu>
wrote:

> 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.
>
>
OK. I should also clarify that the built-in function I was referring to is
in Oberon Microsystem's BlackBox implementation. If you are using another
version of older Oberon you could only rely on a version of the MIN
function which has a type as a parameter. It returns the minimum value of
that type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20221024/b9a65052/attachment.html>


More information about the Oberon mailing list