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,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: "Must instantiate controlled types at library level." Why? Date: Wed, 19 May 2004 16:15:19 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de JhdBEhKREr3dN4iOdUY+SAJqNQcei4Abe39xNtsnbw3r+JSfU= X-Newsreader: Forte Agent 1.8/32.548 Xref: controlnews3.google.com comp.lang.ada:687 Date: 2004-05-19T16:15:19+02:00 List-Id: On Wed, 19 May 2004 13:09:54 +0000 (UTC), Georg Bauhaus wrote: >Dmitry A. Kazakov wrote: > >Hm. First you say, > >: Things like availability of class-wide >: programming, MI, MD, interface inheritance, supertyping etc are >: essential for, say, container library. > >Then, > >: This heavily influences the >: whole design. It is C++'s insufficient ADT which led to STL. > >So I guess you have definitions of "container library" and ADT >that are both novel in some respect? Would you mind telling us? It is a bit too late for Ada 2005! (:-)) >: The major problem is weakness of Ada's ADT. Unfortunately people keep >: on looking in wrong direction. Generics won't help. > >Then what will help an Abstract Datatype? How? The discussion started with the question why String should or not be a built-in type. Isn't String a container type? I think that everybody would agree that String is much better than either vector or generic thousand parameters package Instantiate_And_Rename_Everything_To_Avoid_Name_Clashes Probably Hyman Rosen would disagree. (*) Now a very simple question, why other containers cannot be made like String? Technically what is needed is abstract array interfaces, abstract index types, discriminants for all types, an ability to put type tags and disctiminants in a dope separate from the value, pure compile-time subprograms to evaluate does, supertypes. Give me that, then ask (:-)) More generally. Generics provide parametrization. It is parametrization which is needed for a container library, not generics. There are alternative ways of parametrization. Who said that parametrization by a type tag, a discriminant, a type constraint are not enough powerful for building a container library? ---- * To prevent questions about varying containers. One can bring String and Unbounded_String under one roof to make them interchangeable. With supertypes one could do it only when needed. -- Regards, Dmitry Kazakov www.dmitry-kazakov.de