comp.lang.ada
 help / color / mirror / Atom feed
From: "Alexandre E. Kopilovitch" <aek@vib.usr.pu.ru>
To: comp.lang.ada@ada-france.org
Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...)
Date: Tue, 14 Oct 2003 21:11:39 +0400 (MSD)
Date: 2003-10-14T21:11:39+04:00	[thread overview]
Message-ID: <mailman.81.1066152730.25614.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <3F8B00F6.1050206@comcast.net>; from "Robert I. Eachus" at Mon, 13 Oct 2003 19:46:41 GMT

Robert I. Eachus wrote:

> > Implicit conversions for literals is the most important case, both practically
> > and ideologically. So, if the choice is between "implicit conversions for
> > literals only" and "no implicit conversions at all, as it is now" then I
> > definitely choose first option.
>
> Go ahead and advocate it,

I suppose you mean proposing that in Ada-Comment, right? (I don't know any
other place for that, as the comp.lang.ada stage is already passed.)

> The tricky 
> part would be proposing the language notation for binding a set of 
> literals to a private type.

Thank you for this hint (I really needed it, and the word "binding" there
appeared somehow important for me). How do you think about straightforward
solution (for that language notation), which relies upon new attribute, say,
Literal_Conversion? I mean that in Ada.Strings.Unbounded package we can include:

  for Unbounded_String'Literal_Conversion use To_Unbounded_String;

(I understand that the same thing we can say using new pragma Literal_Conversion:

  pragma Literal_Conversion (Unbounded_String, To_Unbounded_String);

but I think that an attribute is somehow better here).

Then, there is a problem, for which I need an advice: should this new feature
(implicit conversion of literals to private types) be restricted to the types
defined in the language standard and types added by an implementation? Or it
should be made available to all user-defined types without any restrictions?
I tend to think there should be some restrictions, but right now I have neither
good criteria for that nor appropriate mechanism for enforcement. Also, I am
in doubt about overriding Literal_Conversion for derived types - whether this
opportunity desirable or not... and how that overriding (for attributes) may
be controlled (the attributes is so mystical thing, I never saw any general
explanation of the nature of and rules for attributes - neither in ARM nor in
Barnes's book nor in Cohen's book).




Alexander Kopilovitch                      aek@vib.usr.pu.ru
Saint-Petersburg
Russia




  parent reply	other threads:[~2003-10-14 17:11 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 [this message]
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
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