From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_40,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!mcvax!dkuug!freja!carllp From: carllp@freja.dk (Carl-Lykke Pedersen) Newsgroups: comp.lang.ada Subject: Re: Ada exceptions Message-ID: <4055@freja.dk> Date: 9 Sep 88 16:57:17 GMT References: <8957@swan.ulowell.edu> <5701@utah-cs.UUCP> Organization: DIKU, U of Copenhagen, DK List-Id: u-dmfloy%sunset.utah.edu@utah-cs.UUCP (Daniel M Floyd) writes: >I've had two messages that say "go Ada". "Go (PL/1), MESA, CLU, ML" PL/1: FACTORIAL: PROCEDURE; DECLARE (N, F) FIXED FIN (31) INIT (1); ON FINISH BEGIN; PUT LIST (N, "FACTORIAL =", F); PUT SKIP; N = N + 1; F = N * F; STOP; END; STOP; END FACTORIAL; Ada: function DIVIDE_CHECK(X, Y: REAL) return REAL is begin if X = 0 then raise SILLY; else X/Y; endif; exception when NUMERIC_ERROR => return 0; when SILLY => return -1; end; Sorry if the syntax isn't correct. I do not have an Ada-compiler (or a PL/1- compiler). Regards CLp .