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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Tue, 14 Sep 2004 10:32:06 +0200 Message-ID: <68zmgy3b894u.rs67cy6jjfiq$.dlg@40tude.net> References: <49dc98cf.0408110556.18ae7df@posting.google.com> <413e2fbd$0$30586$626a14ce@news.free.fr> <2cR0d.1623$IO5.1267@trndny04> <17sx057ro5jw5$.t2qlaeoxg611$.dlg@40tude.net> <1095082522.132276@master.nyc.kbcfp.com> <18ym85v67zof3$.7oqswzjfgswr.dlg@40tude.net> <1095090665.624419@master.nyc.kbcfp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de i2iVmpzh51H8y/lAC4lb6waUoWm+HGBioKCrGt4riK13WNdLw= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:3708 Date: 2004-09-14T10:32:06+02:00 List-Id: On Mon, 13 Sep 2004 11:51:05 -0400, Hyman Rosen wrote: > Dmitry A. Kazakov wrote: >> There should be no char* (pointers) at all, that's for C++. For Ada, all >> string types should be related types. > > I assume that the pointer thing in Ada was added so that Ada code could > more easily access C/C++ interfaces which want char *. Then that should be Interfaces.C.Strings.chars_ptr. I suppose that the intention was a kind of ersatz to To_String. > You might still > want pointers in Ada so you can do ragged string arrays, like the C > char *x[] = { "1", "12", "123" }; This is why I wrote about incorrectness. IF Ada's strings were designed as a set of related types, then "..." literals could be ones of/convertible to Unbounded_String and so an initialized ragged array would be no problem, instead of horrific: type Ragged is array (Integer range <>) of Unbounded_String; X : constant Ragged := ( To_Unbounded_String ("1"), To_Unbounded_String ("12"), To_Unbounded_String ("13") ); Pascal's lessons still to be learned. Bounds, whatever static, bound or dynamic should not be a part of the string type! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de