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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9b2046241520981f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-26 10:08:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!usenet-fr.net!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: Ada 0x, exception idea ? Date: Sat, 26 Jul 2003 12:08:56 -0500 Organization: ENST, France Message-ID: References: NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1059239329 39614 137.194.161.2 (26 Jul 2003 17:08:49 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 26 Jul 2003 17:08:49 +0000 (UTC) To: comp.lang.ada@ada.eu.org Return-Path: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020828 X-Accept-Language: en-us, en X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:40847 Date: 2003-07-26T12:08:56-05:00 > Bletch. > > As you observe, your proposed constructs are precisely equivalent to > > call_procedure(..., success); > if not success then > raise call_failed; > end if; > >Ada in general does not bother with unnecessary syntactic sugar, > which is what this is. ... and as a "generalization", that is a dubious position. For as long as I can remember, Ada IS ABOUT MAINTAINENCE, which is about using "syntatic sugar" to make things absolutely clear. READABILITY raise Call_Error1 when Condition1; raise Call_Error2 when Condition2; raise Call_Error3 when Condition3; raise Call_Error4 when Condition4; raise Call_Error5 when Condition5; ... is lot more readable than and equivalent ... if Condition1 then raise Error1; elsif Condition2 then raise Error2; elsif Condition3 then raise Error3; elsif Condition4 then raise Error4; elsif Condition5 then raise Error5; ... > ... procedure itself should raise the exception, not set a status > flag ... How nice for you to live in a purely Ada world :-) The mostly "C" world I live in, where I have to interface Ada to the underlying operating environment, almost always uses a return code of some kind. -- ------------------------------------------------- -- Merge vertically for real address -- -- s n p @ t . o -- k i e k c c m -------------------------------------------------