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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc9636dd2392f5bd X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Problem with function return Date: 2000/04/03 Message-ID: <8c96al$rr5$1@nnrp1.deja.com>#1/1 X-Deja-AN: 605898758 References: <38e7a0c8$0$17676@businessnews.de.uu.net> <8F0AB9788synoptikdamudderfuck@news> X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Apr 03 04:22:59 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-03T00:00:00+00:00 List-Id: In article <8F0AB9788synoptikdamudderfuck@news>, synoptik@home.com (A. Logue) wrote: > At work we have an informal standard to declare a "Nil" kind > as the first kind for all enumerated types. For example > type color_kind is (nil, red, green, blue); > This works great in many cases where the return type cannot be > determined > (for whatever reason), simply return a nil kind and let the > function's This seems a bad idea to me, it will result in C-like errors of the caller forgetting to check for an error, yes it may be caught, but it is much to easy for it to get swallowed up, e.g. by the else clause of an if. Much better to raise an exception. if the caller wants to handle it they can put an exception handler at the call site. If they don't want to handle it, or more likely they forget, then the exception gets raised and unhandled, which is often better than blindly carrying on! Sent via Deja.com http://www.deja.com/ Before you buy.