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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1bb9627c57b7d5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-17 16:03:55 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F907513.40901@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) References: <3F86F5FE.4050104@comcast.net> <3F88E067.30209@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc51.ops.asp.att.net 1066431780 24.34.139.183 (Fri, 17 Oct 2003 23:03:00 GMT) NNTP-Posting-Date: Fri, 17 Oct 2003 23:03:00 GMT Organization: Comcast Online Date: Fri, 17 Oct 2003 23:03:01 GMT Xref: archiver1.google.com comp.lang.ada:1110 Date: 2003-10-17T23:03:01+00:00 List-Id: Randy Brukardt wrote: > "Robert I. Eachus" wrote in message > news:3F88E067.30209@comcast.net... > >>Now if you want to recommend that in Ada 200X, package >>Ada.Strings.Unbounded include: >> >> function "+" (Source : in String) return Unbounded_String >> renames To_Unbounded_String; >> function "+" (Source : in Unbounded_String) return String >> renames To_String; >> >>I will certainly support that. I don't really know why they were left >>out of Ada.Strings.Unbounded while > > > They were briefly in AI-301's improvements to Ada.Strings, but enough people > think that they're ugly that they were taken out. Foo: Unbounded_String := + "some_string"; -- is ugly? Was anything offered as a non-ugly alternative? And Russ still thinks there is some point to arguing for adding += to Ada? Lots of luck Russ, but don't be surprised if many of us feel that you are Don Quixote tilting at windmills. > No, actually it wouldn't. It would make a lot of existing code ambiguous. > > A : Unbounded_String; > B : Unbounded_String := A & "something"; > > Since the string literal could have either type String or Unbounded_String, > and "&" can have operands of either type, the expression would become > ambiguous. Ouch! I forgot about that case when explaining why the non-literal conversions would be ambiguous. Having worked on this though, you can handle it as you say by a completely new package with different overloadings of "&"--which won't happen. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig