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: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Mon, 9 Jun 2014 09:06:27 +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> <53942fa4$0$6670$9b4e6d93@newsspool3.arcor-online.net> <234602fb-4571-4b4d-b16c-7a4984511fe4@googlegroups.com> 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 X-Original-Bytes: 2843 Xref: number.nntp.dca.giganews.com comp.lang.ada:186790 Date: 2014-06-09T09:06:27+02:00 List-Id: On Mon, 09 Jun 2014 08:30:34 +0300, Niklas Holsti wrote: > On 14-06-08 22:36 , Dmitry A. Kazakov wrote: >> On Sun, 8 Jun 2014 09:13:11 -0700 (PDT), Dan'l Miller wrote: >> >>> Unfortunately, Ada's downcast syntax is not so obnoxiously conspicuous to >>> the human eye or to mere regular-expression-only pattern-matchers. >> >> Downcast is not a problem in the given example. The problem is >> inconsistently implemented multi-method. > > In Georg's example, the methods have a single argument, so it was not a > mixed multi-method problem. I mentioned the mixed multi-method case as > an Ada run-time error that is closer to a "missing method" error. Yes. Your example was correct. I objected to Georg's analysis. Syntax of downcast is barely related to this. In both cases the language invents a method (e.g. as raising something), since a call cannot really fail anyway. The language-invented methods here are unsafe because it is not what the programmer would normally expect calling them [*]. Thus in both cases the languages are unsafe. Ada is obviously safer because the area where the problem arise is much narrower (only tagged types, only multi-methods, only certain and rare cases of multi-method calls). ------ * Robert's definition of unsafety formulated differently: unexpected behavior from familiar syntax ["misuse"]. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de