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,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Sat, 5 Apr 2008 19:31:48 -0500 Organization: Jacob's private Usenet server Message-ID: References: <47F26C46.3010607@obry.net> <44d88b93-6a90-4c18-8785-2164934ba700@a9g2000prl.googlegroups.com> <47F652F7.9050502@obry.net> <47f7028d$1_6@news.bluewin.ch> <47F749CB.30806@obry.net> <47f7644d_2@news.bluewin.ch> <47F76D31.2090009@obry.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1207441963 20886 69.95.181.76 (6 Apr 2008 00:32:43 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sun, 6 Apr 2008 00:32:43 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:20845 Date: 2008-04-05T19:31:48-05:00 List-Id: "Pascal Obry" wrote in message news:47F76D31.2090009@obry.net... > Gautier, > > > function S (Source : Ada.Strings.Unbounded.Unbounded_String) return > > String > > renames Ada.Strings.Unbounded.To_String; > > function U (Source : String) return > > Ada.Strings.Unbounded.Unbounded_String > > renames Ada.Strings.Unbounded.To_Unbounded_String; > > I'm doing the same with operator "+" and "-", but I'm not happy with > that. You do not need the parenthesis with operators: The only useful use for "+" in Ada is for conversions. So it is a common convention (I use it sometimes). We actually considered adding that rename to the strings packages, but enough people thought it was ugly that it wasn't done. (It needs getting used to, thus the hope of making the intent clearer by including it in the packages.) We also briefly considered adding an operator symbol specifically for this purpose. Something like function "#" (Source : String) return Unbounded_String; But the people who don't think "+" is ugly were against this, because we already have such an operator and thus don't need another one. Thus a deadlock. Sigh. > external_packer: array(External) of Unbounded_String:= > ( +"zip.exe", > +"7z.exe", > +"kzip.exe"); > > Better than nothing... I agree, and it doesn't look so ugly if you can think of unary "+" as the conversion operator. (Personally, I'd prefer a different symbol for this purpose, but "+" has the advantage of actually working now.) Randy.