comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...)
Date: Fri, 17 Oct 2003 15:26:39 -0500
Date: 2003-10-17T15:26:39-05:00	[thread overview]
Message-ID: <vp0jvhmtarb541@corp.supernews.com> (raw)
In-Reply-To: 3F88E067.30209@comcast.net

"Robert I. Eachus" <rieachus@comcast.net> 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.

Earlier, Robert said:

> And as I said, I think adding implicit conversion of string literals to
> and from Unbounded_String would work.

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.

It's virtually impossible to "improve" the current Ada.Strings.Unbounded.
We'd have to create a whole new package for that, and that would be a tough
sell for the standard. My preference would be a package in which String
occurs only in the To_xxx routines, along with a way to use string literals
directly as Unbounded_Strings. (Non-literal conversions from String should
be explicit.) That would be a much more consistent abstraction than
Ada.Strings.Unbounded. But we're pretty much stuck with
Ada.Strings.Unbounded as it is.

                 Randy.






  parent reply	other threads:[~2003-10-17 20:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-02 18:02 U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) amado.alves
2003-10-03  0:05 ` U : Unbounded String : " Alexander Kopilovitch
2003-10-03 20:46   ` Dmitry A. Kazakov
2003-10-03  9:00 ` U : Unbounded_String := " Preben Randhol
2003-10-03 11:17   ` Jeff C,
2003-10-04  2:49     ` Robert I. Eachus
2003-10-06 23:57       ` Alexandre E. Kopilovitch
2003-10-07  8:51         ` Dmitry A. Kazakov
2003-10-08 19:12           ` Alexandre E. Kopilovitch
2003-10-09  8:42             ` Dmitry A. Kazakov
2003-10-10 20:58               ` Alexander Kopilovitch
2003-10-13  8:35                 ` Dmitry A. Kazakov
2003-10-13 21:43                   ` Alexandre E. Kopilovitch
2003-10-14  8:09                     ` Dmitry A. Kazakov
2003-10-16  9:39                       ` Alexandre E. Kopilovitch
2003-10-18 10:57                         ` Dmitry A. Kazakov
2003-10-08 23:18         ` Robert I. Eachus
2003-10-09 21:35           ` Alexandre E. Kopilovitch
2003-10-10 18:10             ` Robert I. Eachus
2003-10-11 19:43               ` Alexandre E. Kopilovitch
2003-10-12  5:03                 ` Robert I. Eachus
2003-10-13  9:07                   ` Dmitry A. Kazakov
2003-10-13 14:36                   ` Alexandre E. Kopilovitch
2003-10-13 19:46                     ` Robert I. Eachus
2003-10-14  1:35                       ` Jeffrey Carter
2003-10-14 17:11                       ` Alexandre E. Kopilovitch
2003-10-14 20:26                         ` Mark A. Biggar
2003-10-14 20:58                           ` Robert I. Eachus
2003-10-15 16:59                           ` Alexandre E. Kopilovitch
2003-10-15 20:38                             ` (see below)
2003-10-16  0:31                               ` Alexandre E. Kopilovitch
2003-10-16  2:30                                 ` (see below)
2003-10-16 13:54                                   ` Alexandre E. Kopilovitch
2003-10-16 14:11                                     ` (see below)
2003-10-16  8:01                             ` Dmitry A. Kazakov
2003-10-17 20:26                   ` Randy Brukardt [this message]
2003-10-17 21:39                     ` Alexandre E. Kopilovitch
2003-10-17 23:03                     ` Robert I. Eachus
2003-10-23 21:11                       ` Alexandre E. Kopilovitch
  -- strict thread matches above, loose matches on Subject: below --
2003-10-03 12:00 amado.alves
2003-10-03 15:54 ` Mark A. Biggar
2003-10-03 20:41 ` Dmitry A. Kazakov
2003-10-03 16:12 amado.alves
2003-10-04 12:16 ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox