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!postnews.google.com!x19g2000prg.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Mon, 7 Apr 2008 07:57:55 -0700 (PDT) Organization: http://groups.google.com 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: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207580276 2333 127.0.0.1 (7 Apr 2008 14:57:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Apr 2008 14:57:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x19g2000prg.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20864 Date: 2008-04-07T07:57:55-07:00 List-Id: On Apr 5, 5:31 pm, "Randy Brukardt" wrote: > "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. Well, I can think of one other potentially useful use: with a numeric argument (especially a numeric literal, or something like pi). It doesn't have any effect but could serve to make things clearer in some mathematical cases. Maybe you'd call a bounded integration routine with +1.0 and -1.0 as the arguments. OK, so that's not much of a use. On the other hand, the idea that "+" represents the identity function is ingrained enough in me that I've resisted using it for a conversion operator even though others around me have been doing that. Call it an obstinate adherence to meaningless purity or whatever. But like Randy, I would have preferred adding one (maybe even two) operator symbols that would have no meaning except that the user could define them, although I'm not sure about "#" since that already has a use (in based numeric literals). I'd prefer something not currently used at all, like "@" or "!" or tilde. Of course, it apparently isn't going to happen anyway so there's not much point arguing about which character would be best. -- Adam