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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Why no Propagates? Date: 1996/10/17 Message-ID: #1/1 X-Deja-AN: 190175493 references: <325D7F9B.2A8B@gte.net> <326391B6.4B23@gsfc.nasa.gov> content-type: text/plain; charset=ISO-8859-1 organization: Estormza Software mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-10-17T00:00:00+00:00 List-Id: In article <326391B6.4B23@gsfc.nasa.gov>, Mike Stark wrote: >To which I would add further the fact that Java requires all >user-defined >exceptions raised by a method to be defined as part of the interface >and caught by the client invoking the method (the "throws" keyword as >used in specifying member functions). Ada does not make the list of >exceptions raised by a subprogram part of the signature, let alone >requiring user-defined exceptions to be handled by the caller. This >alone is not a reason to say Java is better than Ada, but it is in- >accurate to say that there are no features where Java has the advantage. >BTW, I am also a fan of interfaces, as was said in another post within >this lengthy thread. The designers of Ada 83 considered including explicitly naming the exceptions propagated by a subprogram: procedure P (X : Integer) propagates A, B, C; This feature, and the reasons it was rejected, is discussed in section 14.5.2 of the Ada 83 Rationale. The reason they did not include the propagates feature is because they felt that it would add too much baggage ("code expansion") to subprograms, especially to those that were otherwise small. Personally, I think it would be a cool feature to have. Let me the programmer decide whether I want to incur the code-expansion penalty. (And if the procedure tries to propagate something other than what's stated, then raise Program_Error.) To the designers of Ada 95: Was this feature considered for inclusion? Is it a candidate for inclusion in Ada 0X? -------------------------------------------------------------------- Matthew Heaney Software Development Consultant mheaney@ni.net (818) 985-1271