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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-02 00:32:57 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? Date: Thu, 02 Oct 2003 09:41:55 +0200 Message-ID: <92lnnvsvcat8eig0aj47cl01cn4ttqjhr2@4ax.com> References: <1064527575.648809@master.nyc.kbcfp.com> <3F739C1D.4030907@attbi.com> <3F78E850.8010401@comcast.net> <3F79751F.3000709@noplace.com> <0k2jnvc2hh1ovrj6v6qqa5jh8ddotduj79@4ax.com> <3F7AC9C9.6090903@noplace.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1065079976 12486254 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:99 Date: 2003-10-02T09:41:55+02:00 List-Id: On Wed, 01 Oct 2003 12:34:29 GMT, Marin David Condic wrote: >Dmitry A. Kazakov wrote: >> >> Which means that Unbounded_String has to be a subtype of String. >> >Why? You create some package that has an "Open" procedrue that uses an >Unbounded_String as the filename parameter - why does it have to be a >subtype of String? No, I create Open with String as the parameter and it will accept Unbounded_String for free. Compare: procedure OpenByNumber (X : Integer); subtype Channel_Number is Integer range 1..29; No : Channel_Number := 10; OpenByNumber (No); -- It is fine >Maybe if we got to design the language from the ground up there would >have been a better way of implementing all this so you could have >strings of fixed or indeterminate length and uased them interchangably. This is the point. The present design of strings just reflects some fundamental language design deficiencies in ADT. Now you have a choice, either to make it right or to patch a leaking bucket. >Given that we can't do that, I guess we could get the same net effect by >having some wider variety of packages with different parameter types for >the same functions. And have a geometric explosion of specifications. Surely we have to provide generic variants of all possible subroutines to support Bounded_Strings as well! (:-)) --- Regards, Dmitry Kazakov www.dmitry-kazakov.de