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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1bb9627c57b7d5b,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-02 11:15:28 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "amado.alves" Newsgroups: comp.lang.ada Subject: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) Date: Thu, 2 Oct 2003 19:02:16 +0100 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: melchior.cuivre.fr.eu.org 1065118038 81067 80.67.180.195 (2 Oct 2003 18:07:18 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 2 Oct 2003 18:07:18 +0000 (UTC) To: Return-Path: X-MimeOLE: Produced By Microsoft Exchange V6.0.6470.0 Content-Class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) thread-index: AcOJD0+dETFCPdNuR3Wo9WaAp0V5MA== X-OriginalArrivalTime: 02 Oct 2003 18:00:07.0152 (UTC) FILETIME=[036D5F00:01C3890F] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:126 Date: 2003-10-02T19:02:16+01:00 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 :=3D "bla bla bla"; However it is too late for Ada 2005 now :-( /* Alexander Kopilovitch wrote: > Robert I. Eachus wrote: >=20 > > ... > > So I never understand all those complaints about explicitly > converting > > to and from Bounded_String (or Unbounded_String). >=20 > (Let's speak about Unbounded_Strings, for clarity). >=20 > There are 2 main reasons for those complaints: >=20 > 1) types Unbounded_String and String appear unrelated, while they are=20 > conceptually related for all natural purposes. (If you want=20 > specifically a fixed-size array of characters which is not assumed to=20 > be a textual line in the application then say "array of Character",=20 > and not "String"). >=20 > 2) there is no literals in Ada for Unbounded_Strings which contradicts = > the natural concept of a textual line of varying > (unlimited) size. >=20 > [From all my experience in (non-corporate) application programming I=20 > must say that while this seemingly tiny and unimportant point remains=20 > unresolved, Ada never will be more popular among programmers than she=20 > is now. And if this point will be resolved with some satifactory way=20 > then Ada's popularity will increase (well, certainly not by magnitude, > but quite noticeably) almost immediately. Well, I'm not sure=20 > that it is a good goal to make Ada more popular; therefore I=20 > can admit that preserving status quo here may be actually a=20 > proper decision.] */