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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!195.208.113.67.MISMATCH!goblin1!goblin.stu.neva.ru!news.tornevall.net!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Reconsidering assignment Date: Mon, 11 Jun 2007 13:57:59 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> <1181428673.148991.76570@p77g2000hsh.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1181588161 10107 69.95.181.76 (11 Jun 2007 18:56:01 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 11 Jun 2007 18:56:01 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:16161 Date: 2007-06-11T13:57:59-05:00 List-Id: "Maciej Sobczak" wrote in message news:1181428673.148991.76570@p77g2000hsh.googlegroups.com... ... > > which were ambiguous: > > > > X : Integer := 1 + 1; > > > > is it Positive'(1)+Positive'(1) or Integer'(1)+Integer'(1)? You will need > > complex preference rules to resolve this mess. > > It's a compile-time expression with the value 2. > Not very complex. ;-) Sorry, Dmitry is right; you seem to have missed his point. In order for this to be "a compile-time expression", you need complex preference rules in your type system. (That is, that "compile-time expressions" are preferred over types that would cause some other kind of expression.) Such rules tend to be very problematic in practice; they often have very counter-intuitive results in some cases. Ada has very few of them for this reason, and the ones it has do not include cases like this one. It takes extreme care to design a self-consistent type system, and without that care, it is impossible to say much of use on the topic. Randy.