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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Fri, 6 Jun 2014 22:42:06 +0200 Organization: cbb software GmbH Message-ID: References: <3bf7907b-2265-4314-a693-74792df531d1@googlegroups.com> <51e9fd4f-e676-4d2f-9e21-1c782d71092e@googlegroups.com> <5391ffa4$0$6611$9b4e6d93@newsspool4.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: AuYlnUSfTZrfhAkRjyySpQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:20174 Date: 2014-06-06T22:42:06+02:00 List-Id: On Fri, 06 Jun 2014 15:43:37 -0400, Robert A Duff wrote: > Niklas Holsti writes: > >> This error is more similar to a subtype or type conversion error, where >> the source value violates the constraints of the target type. > > It is EXACTLY a type conversion error. I would say it not a conversion error, it is a mandated behavior of the type conversion operation. No error, since you could write a legal program that would exploit this behavior. > The Tag is wrong, so the type > conversion raises Constraint_Error. It never gets to the dispatching > call. Semantically it dispatches to a "body" that raises Constraint_Error. Furthermore, whether the check is made on the callee's or caller's context is irrelevant, the behavior is just same. > There is no dangling dispatching in Ada! It is impossible for > a call to (try to) call the nonexistent body of an abstract operation. Yes. The difference is, as always, in the time the checks happen. In Ada the check for a missing body happens at compile time, which is why it is safe. Anything that happens at run-time is no more error and *if* unanticipated then is a bug. The advantage of Ada is to prevent undesired things to happen at run-time through static typing. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de