[Oberon] Error handling in Oberon procedures/functions.
bob at web-options.com
Thu May 24 15:16:11 CEST 2018
The answer is different for procedures and functions.
For procedures it is normally enough to use a result parameter and test it after each call.
For functions, as far as possible the compiler should prevent you from supplying an input value which is not mapped to an output. So the data type of the input should be a mapped subset of the domain of the function.
If that is not possible or practical, test the value of the input parameter and invoke the function only if the value is mapped.
If that is not possible then behave like n/0, and trap.
> On 24 May 2018, at 13:50, Srinivas Nayak <sinu.nayak2001 at gmail.com> wrote:
> Dear All,
> Which is the Oberon best practice of handling errors in procedures/functions?
> I think, this small and nice paper sets my context well.
> "Faults in functions, in ALGOL and FORTRAN" by I. D. Hill
> With thanks and best regards,
> Yours sincerely,
> Srinivas Nayak
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
More information about the Oberon