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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1bb9627c57b7d5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-03 04:17:19 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!news.uchicago.edu!news.cc.uic.edu!hammer.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc02.POSTED!not-for-mail From: "Jeff C," Newsgroups: comp.lang.ada References: Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <2Vcfb.27020$%h1.17020@sccrnsc02> NNTP-Posting-Host: 66.31.4.164 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc02 1065179838 66.31.4.164 (Fri, 03 Oct 2003 11:17:18 GMT) NNTP-Posting-Date: Fri, 03 Oct 2003 11:17:18 GMT Organization: Comcast Online Date: Fri, 03 Oct 2003 11:17:18 GMT Xref: archiver1.google.com comp.lang.ada:147 Date: 2003-10-03T11:17:18+00:00 List-Id: "Preben Randhol" wrote in message news:slrnbnqekm.j6.randhol+valid_for_reply_from_news@kiuk0152.chembio.ntnu.no... > On 2003-10-02, amado.alves wrote: > > User-defined implicit conversion would solve this problem. Pragma approach: > > > > function To_Unbounded (S : String) return Unbounded_String; > > pragma Implicit_Conversion (To_Unbounded); > > U : Unbounded_String := "bla bla bla"; > > > NONONONONONONO > > Implicit conversion is the mother of all bugs. It is a nightmare in > FORTRAN 77 and you have to put a definistion turning it off. > > Preben While I somewhat agree with your basic premise here, we already have implicit conversion in Ada for numeric literals. e.g I can write type My_Integer is range 0 .. 10; a : my_integer := 10; I dont have to write A : my_integer := to_my_integer(10); So I agree that fixing the string problems via an all powerful pragma might be a bad idea. Establishing the idea of a Universal String might not be a bad idea..... Although in reality once if we just really standardize on "+" doing a conversion and being in the standard I think the extra syntax overhead is pretty minimal.