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,ace3fca092a457cd X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Unary operator after binary operator: legal or not? References: From: development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de (Markus E.L.) Organization: N/A Date: Tue, 31 Jul 2007 01:39:17 +0200 Message-ID: User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:OL0OwyP3BHD9S/s5viFHw3eL9sw= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.241.161 X-Trace: news.arcor-ip.de 1185838089 88.72.241.161 (31 Jul 2007 01:28:09 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!news2.euro.net!newsfeed.freenet.de!news.unit0.net!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:1305 Date: 2007-07-31T01:39:17+02:00 List-Id: > Here's something confusing I encountered: > > with Ada.Strings.Unbounded; > > function Xyz (Left, Right : in Ada.Strings.Unbounded.Unbounded_String) > return String is > function "+" (Right : in Ada.Strings.Unbounded.Unbounded_String) > return String renames Ada.Strings.Unbounded.To_String; > begin -- Xyz > if +Left <= +Right then > return +Left & +Right; > -- ^ Error reported here. > end if; > end Xyz; > > A compiler reports "missing operand", referencing the space after the "&". > > Why then does it accept the comparison in the previous line? Both are > > +Left [binary operator] +Right Precedence? Regards -- Markus