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 16:04:52 +0200 Message-ID: <11tjdpsch74g0.158lc7jpe3vz5$.dlg@40tude.net> References: <49dc98cf.0408110556.18ae7df@posting.google.com> <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> <68zmgy3b894u.rs67cy6jjfiq$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de G0COdSHbeCP5cBYNMbgTkQOdNuib+Pwr2ykLSPdjYz6X2kyIU= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:3718 Date: 2004-09-14T16:04:52+02:00 List-Id: On Tue, 14 Sep 2004 09:07:18 +0000 (UTC), Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: >: 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") >: ); > > Is it really a good idea to sprinkle source code with unnamed > string values? It is a bad idea (provided that these values do not represent themselves.) There is no difference to numeric literals with that respect. Yes, magic constants are bad, but that by no means imply that universal integer should to be removed and for each custom integer type we should write X : My_Int := My_Int (1); > (No matter in what language.) If all of them are > isolated in some module(s), where's the problem. The problem is a geometric explosion of interfaces in cases like: procedure Connect (DB : in out Data_Base; Server, Name, Password : String); Now you have 3 string parameters each of them can separately be: String, Wide_String, Unbounded.Unbounded_String, Wide_Unbounded.Unbounded_String. For the user point of view, what is the difference between String and Unbounded_String to require explicit conversions between them? Isn't it an implementation detail? > Is it an > aesthetical problem to have to use Ada's verbosity with strings? With strings it becomes compelling. The problem is fundamental, Ada's support of interface implementation is very rudimental. You cannot define the interface of abstract characters and then the interface of an abstract array of abstract characters. String, Unbounded_String, Wide_String etc are just implementations of that interface. They should be just subtypes of a Universal_String. And what will we do when Wide_Wide_String come? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de