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 X-Google-Thread: 103376,73f81e5f5d6ee80f X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.germany.com!border1.nntp.ams.giganews.com!nntp.giganews.com!npeer.de.kpn-eurorings.net!npeer-ng1.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: MI is sloppy Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1g29uf1ygl1wc$.1x184o2bk9m0k$.dlg@40tude.net> <1hjx0k7xmfw4n$.14q7chpo1r1ma$.dlg@40tude.net> <49424203$0$31868$9b4e6d93@newsspool3.arcor-online.net> <494255e8$0$31331$9b4e6d93@newsspool4.arcor-online.net> Date: Fri, 12 Dec 2008 14:35:50 +0100 Message-ID: <43lprrmyik2q.1esp72deqcw6o.dlg@40tude.net> NNTP-Posting-Date: 12 Dec 2008 14:35:50 CET NNTP-Posting-Host: ba6fc4ab.newsspool2.arcor-online.net X-Trace: DXC==G6;>SiA7d^U6b:FjPaGjQA9EHlD;3YcR4Fo<]lROoRQ^YC2XCjHcbYn0UIHeEV2c\DNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgRP;kh?>C1]oP X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2976 Date: 2008-12-12T14:35:50+01:00 List-Id: On Fri, 12 Dec 2008 13:15:35 +0100, Georg Bauhaus wrote: > Dmitry A. Kazakov schrieb: > >>> If you have an ambitious compiler, it might reach out, >>> at compile time, for objects whose behavior is then known >>> to be constrained by membership in a then known specific >>> subtype. >> >> ... and then inline raising Constraint_Error. Great! >> >> Constraint_Error propagation is the contracted behavior. You have signed >> that contract, enjoy it. > > But the compiler informs you that Constraint_Error will > be raised if your program is such that it will be raised. > Anything wrong with correcting the program? How? The program is already correct it does what you asked it to do. > Deriving another type, even if not sufficiently different > from the original to warrant a type, is another formal > way to trigger the same effect on the programmer, at compile > time: "There is something odd about your program". No, the effect is fundamentally different. The effect is that the program becomes illegal, it may not run. > If we wanted more of the minor differences covered > by type hierarchies, we might end up with a Qi type > system... For Ada? 1. Qt is not a programming language. 2. There is no minor differences in terms of correctness. An incorrect program is incorrect. There is no *any* way to predict the effect of incorrectness. The system is not only instable, it is simply unknown. It does not obey the logic of (some) physical systems, where you can A) measure the change, B) measure the effects. There is no metric, no distance, no way to measure things, it is just non-continuous etc. "minor differences" is meaningless. Last but not least, how are you going to make differences visible to the program reader? By writing comments explaining when and how Constraint_Error, other exceptions, and program crashes would happen? What's wrong with using C for that? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de