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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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-03 13:41:47 PST Path: archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!dialin-145-254-038-072.arcor-ip.NET!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: U : Unbounded String : "bla bla bla"; (was: Is the Writing...) Date: Fri, 03 Oct 2003 22:46:45 +0200 Organization: At home Message-ID: References: Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dialin-145-254-038-072.arcor-ip.net (145.254.38.72) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de 1065213705 14204566 145.254.38.72 (16 [77047]) User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:172 Date: 2003-10-03T22:46:45+02:00 List-Id: Alexander Kopilovitch wrote: > amado.alves wrote: > >> 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"; > > Implicit conversions lead to some problems (it is also known from C++ > experience.) I'm sure that it would be serious mistake to add implicit > conversions to the language for purposes of this rank only. Generally, I > think that implicit conversion are significantly less compatible with Ada > spirit than with C++ spirit; in C++ implicit conversions probably do more > good than bad, while in Ada they probably will do more bad than good. No they are always bad. Conversions has to allowed between related types only. So instead of making arbitrary short-cuts between the types one has to organize them in an appropriate way. For instance, all string types have to have a common ancestor. And importantly, to have an ancestor, should not imply either taggedness or implementation inheritance. -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de