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: mab@dst17.wdl.loral.com (Mark A Biggar) Subject: Re: Two ideas for the next Ada Standard Date: 1996/09/05 Message-ID: <50ms2p$4e4@wdl1.wdl.lmco.com>#1/1 X-Deja-AN: 178678857 references: <50gelc$2le@goanna.cs.rmit.edu.au> organization: Loral Western Development Labs newsgroups: comp.lang.ada Date: 1996-09-05T00:00:00+00:00 List-Id: In article jsa@alexandria (Jon S Anthony) writes: >In article bobduff@world.std.com (Robert A Duff) writes: >> Another choice is to declare a root integer type, and declare the >> function as primitive of that type, and inherit that function for all >> your integer types. But this requires everything to be derived from a >> single root type, which inhibits code reuse. >Interesting. Care to elaborate (so to speak...)? The original Ada9x (before the trim down) had the idea of allowing the use of 'CLASS on non-tagged types for just this purpose. E.g. you could declare a procedure like: procedure My_Op(P1: Integer'CLASS; P2: in out Float'CLASS); Valid parameter for P1 and P2 could be anything of a type derived from Integer and Float respectively. This is very similar to the above method but the compiler implisitely does the required conversions. This would make a reasonably simple GNAT experimential extension. -- Mark Biggar mab@wdl.lmco.com