comp.lang.ada
 help / color / mirror / Atom feed
* RE: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...)
@ 2003-10-03 12:00 amado.alves
  2003-10-03 15:54 ` Mark A. Biggar
  2003-10-03 20:41 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 44+ messages in thread
From: amado.alves @ 2003-10-03 12:00 UTC (permalink / raw)
  To: comp.lang.ada

"...we already have implicit conversion in Ada for numeric literals." (Jeff)

I know, and that was the 'precedent' for my proposal. And I'm familiar with the 'nightmare' of generalised implicit conversion (in C). But this could be tamed in Ada by defining the effect scope of pragma Implicit_Conversion to be the immediately enclosing block.

Or a family of such pragmas for fine control of the effect:

  Implicit_Conversion_Down_From_Here
  Implicit_Conversion_Up_To_The_Next_Enclosing_Block
  Implicit_Conversion_All_Over

However I am not totally confortable with *pragmas* for this class of effect. Is their precedence?



^ permalink raw reply	[flat|nested] 44+ messages in thread
* RE: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...)
@ 2003-10-03 16:12 amado.alves
  2003-10-04 12:16 ` Preben Randhol
  0 siblings, 1 reply; 44+ messages in thread
From: amado.alves @ 2003-10-03 16:12 UTC (permalink / raw)
  To: comp.lang.ada

"It's alright to make legal things illegal (E.g.,
pragma restrictions) but not the other way." (Mark)

Then make the implicit conversion legal, and supply the restriction No_Implicit_Conversion ;-)








^ permalink raw reply	[flat|nested] 44+ messages in thread
* U : Unbounded_String := "bla bla bla"; (was: Is the Writing...)
@ 2003-10-02 18:02 amado.alves
  2003-10-03  0:05 ` U : Unbounded String : " Alexander Kopilovitch
  2003-10-03  9:00 ` U : Unbounded_String := " Preben Randhol
  0 siblings, 2 replies; 44+ messages in thread
From: amado.alves @ 2003-10-02 18:02 UTC (permalink / raw)
  To: comp.lang.ada

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";

However it is too late for Ada 2005 now :-(

/*
Alexander Kopilovitch wrote:

> Robert I. Eachus wrote:
> 
> > ...
> > So I never understand all those complaints about explicitly
> converting
> > to and from Bounded_String (or Unbounded_String).
> 
> (Let's speak about Unbounded_Strings, for clarity).
> 
> There are 2 main reasons for those complaints:
> 
> 1) types Unbounded_String and String appear unrelated, while they are 
> conceptually related for all natural purposes. (If you want 
> specifically a fixed-size array of characters which is not assumed to 
> be a textual line in the application then say "array of Character", 
> and not "String").
> 
> 2) there is no literals in Ada for Unbounded_Strings which contradicts 
> the natural concept of a textual line of varying
> (unlimited) size.
> 
> [From all my experience in (non-corporate) application programming I 
> must say that while this seemingly tiny and unimportant point remains 
> unresolved, Ada never will be more popular among programmers than she 
> is now. And if this point will be resolved with some satifactory way 
> then Ada's popularity will increase (well, certainly not by magnitude,
> but quite noticeably) almost immediately. Well, I'm not sure 
> that it is a good goal to make Ada more popular; therefore I 
> can admit that preserving status quo here may be actually a 
> proper decision.]
*/




^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2003-10-23 21:11 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-03 12:00 U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) amado.alves
2003-10-03 15:54 ` Mark A. Biggar
2003-10-03 20:41 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2003-10-03 16:12 amado.alves
2003-10-04 12:16 ` Preben Randhol
2003-10-02 18:02 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
2003-10-17 21:39                     ` Alexandre E. Kopilovitch
2003-10-17 23:03                     ` Robert I. Eachus
2003-10-23 21:11                       ` Alexandre E. Kopilovitch

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