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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b47b15fda2aeb0b2 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Two ideas for the next Ada Standard Date: 1996/09/05 Message-ID: #1/1 X-Deja-AN: 178576689 references: <50aao3$3r88@news-s01.ny.us.ibm.net> <50gelc$2le@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-09-05T00:00:00+00:00 List-Id: In article , Jon S Anthony wrote: >In article bobduff@world.std.com (Robert A Duff) writes: >... But this requires everything to be derived from a >> single root type, which inhibits code reuse. > ^^^^^^^^^^^^^^^^^^^^^^^^^ > >Interesting. Care to elaborate (so to speak...)? I just meant that if I say, "I have a bunch of neat functionality you can use, but only if you derive all your types from Bob_Duffs_Package.Bob_Duffs_Root_Type", and you say you also have a bunch of neat stuff, but you have to derive from "Jon_Anthonys_Root_Type", and we've never heard of each other, then our types won't be derived from each other, and somebody who wants to use both sets of neat functionality will be stuck. E.g. within a single project, you can declare a type Root_Integer, with a primitive operation Image (like 'Image, but better), and derive all your integer types from that. (For efficiency, you might want more than one such root in the project, but that's beside the point.) Now, we have an Image function that works for all integer types. Except those types that came from some outside place that never heard of our convention. Similarly, you can declare a root tagged type, and give it a primitive Hash function, so anything in that hierarchy can be put in a hash table. But it doesn't work if you import lots of tagged types from some third party that doesn't know about that root type, and you want to put *those* things in your hash table. This isn't a criticism -- just a fact of life. - Bob