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,f712c3cc98e7f25 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!kanaga.switch.ch!switch.ch!news.rediris.es!not-for-mail From: Manuel Collado Newsgroups: comp.lang.ada Subject: Re: not X'Length Date: Fri, 16 May 2008 10:04:23 +0200 Organization: RedIRIS Message-ID: References: <482c0030$0$7542$9b4e6d93@newsspool1.arcor-online.net> <954e4cd2-11a9-420b-85c4-7741c429e1b2@c65g2000hsa.googlegroups.com> <482ca195$0$6788$9b4e6d93@newsspool2.arcor-online.net> <717bf87e-b8b6-4129-8051-7bd45cf2f7b2@a9g2000prl.googlegroups.com> NNTP-Posting-Host: sri202.sri.fi.upm.es Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: heraldo.rediris.es 1210925134 7219 138.100.242.202 (16 May 2008 08:05:34 GMT) X-Complaints-To: jesus.heras@rediris.es NNTP-Posting-Date: Fri, 16 May 2008 08:05:34 +0000 (UTC) User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) In-Reply-To: <717bf87e-b8b6-4129-8051-7bd45cf2f7b2@a9g2000prl.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:92 Date: 2008-05-16T10:04:23+02:00 List-Id: Adam Beneschan escribi�: > On May 15, 1:48 pm, Georg Bauhaus > wrote: >> christoph.gr...@eurocopter.com wrote: >>> From RM 4.4 follows that this is equivalent to >>> if (not X'Length) in Positive then >>> Now Universal_Integer (X'Length is of this type) has no operators, so >>> it has to be converted to an appropriate type. This is Integer (or, to >>> be very precise, the type of Integer) in this case. But then there is >>> no "not" defined for this type. So the compiler is correct. >> While the compilers are correct, on the programmer's part the >> issue is not that easy to understand in general. >> You have demonstrated why this is so. Hence my original >> question about programmer expectations regarding improved >> compiler's diagnostics in this case. > > You may be right that a better diagnostic would help in this specific > case. But a programmer cannot expect a compiler to be a mind-reader. > And a compiler writer can't really go through every possible weird > combination of things to figure out what sorts of accidental trouble a > programmer could get themselves into---there are just too many > possibilities. About all a compiler writer can do is respond to > particular situations when they get noticed. Perhaps the compiler could state how the expression is parsed, so the diagnostic message can be better understood: if not X'Length in Positive then | >>> incompatible types: parsed as >>> if (not X'Length) in Positive then Just my 2c. -- Manuel Collado - http://lml.ls.fi.upm.es/~mcollado