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,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-21 00:44:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.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: Imitation is the sincerest form of flattery Date: Fri, 21 Mar 2003 09:44:35 +0100 Message-ID: References: <1047665830.579605@master.nyc.kbcfp.com> <7eee7v4hpvj0i5s345uonlen5315rhiau8@4ax.com> <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> 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: fu-berlin.de 1048236275 75930794 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:35586 Date: 2003-03-21T09:44:35+01:00 List-Id: On Thu, 20 Mar 2003 14:27:12 GMT, "Frank J. Lhota" wrote: >"Dmitry A. Kazakov" wrote in message >news:p2vi7vs64p33mpnbsfsn43cvh72l44tm95@4ax.com... >> To inherit the type interface. For example, an array type implemented >> by a record type: >> >> -- This is not Ada! >> type Unbounded_String is >> private array (Integer range <>) of Character; >> >> private >> type Unbounded_String is record >> ... >> end record; >> -- Definition of implemented abstract array opeartions follows > >I'm a little unclear about what you're asking for here. In your envisioned >vision of Ada, what does this code do? A private implementation of an array type. If the language have had full ADT there would be no need predefined Unbounded_String. Or consider the following: type Sparse_Matrix is private array (Integer range <>; Integer <>) of Element; It has an array interface, but internally it is also a record type using a list to keep the array elements. >How would it differ from doing >something like this: > > -- This is Ada! > type Unbounded_String ( First, Last : Integer ) is private; > >private > type Unbounded_String is record > ... > end record; The above isn't an array. You cannot use it where an array is expected. It has no 'First, 'Last, no slices etc. ----- The problem with ADT in Ada is that technically there is only two (*) type interfaces you can inherit from (implement privately): type ... is private; type ... is limited private; At the same time Ada's set of built-in interfaces is far more richer: type ... is access ...; type ... is delta ...; type ... is mod ...; type ... is array ...; type ... is record ...; protected type ...; task type ...; etc. In my view to fully support ADT would mean that any of such type interfaces would be available for private implementation. ----- (*) I intentionally omit type ... is tagged ..., because I believe that *all* types have to be tagged. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de