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-13 02:07:21 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) Date: Mon, 13 Oct 2003 11:07:39 +0200 Message-ID: <48pkovonvph42t4vrgptvrkpldrho554e9@4ax.com> References: <3F86F5FE.4050104@comcast.net> <3F88E067.30209@comcast.net> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1066036040 21113869 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:766 Date: 2003-10-13T11:07:39+02:00 List-Id: On Sun, 12 Oct 2003 05:03:09 GMT, "Robert I. Eachus" wrote: >String literals are a universal type that can be implicitly converted to >any string type. As I said it would be possible to make this case legal >by making Unbounded_String (and presumably similar types) string types. > But that would work against what you really want, since now, if you >also allow > > Foo: String := "foo"; > O_S : Unbounded_String := Foo; --implicit conversion > U_S : Unbounded_String := "literal"; -- Can't work now. > ^ ambiguous could be: > function ""(L: string_literal) return Unbounded_String; >or > function ""(L: string_literal) return String; followed by > function ""(L: String) return Unbounded_String; and function ""(L: string_literal) return String; followed by function ""(L: String) return Unbounded_String; followed by function ""(L: Unbounded_String) return String; followed by function ""(L: String) return Unbounded_String; followed by function ""(L: Unbounded_String) return String; followed by ... Clearly domination rules a la C++ are required to disambiguate type conversions. Moreover one will probably need some pragmas to prioritize conversions. For instance, to ensure that for temp results the compiler would prefer String over Unbounded_String. It is not easy, though nobody claimed that it is! (:-)) --- Regards, Dmitry Kazakov www.dmitry-kazakov.de