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,89a10de5b2ea87d7 X-Google-Attributes: gid103376,public From: mfb@mbunix.mitre.org (Michael F Brenner) Subject: Re: generic binary tree in ada 83 Date: 1998/04/28 Message-ID: <6i55q1$nfe@top.mitre.org>#1/1 X-Deja-AN: 348484836 References: <35461333.6DFB@westcott.force9.co.uk> Organization: The MITRE Corporation, Bedford Mass. Newsgroups: comp.lang.ada Date: 1998-04-28T00:00:00+00:00 List-Id: > I have it working on a single character, but cannot get > it to work on generic data. Just add the following lines on top of your package that implements the Tree data structure on type character: generic type character is private; and it will work on generic data. To instantiate it, use the following code: package tree_of_limbs is new character_tree (character => limbs); Then it will work on TYPE LIMBS exactly as it worked on type character. The operational thing here, is that you already have it working on a single character. If you did not, then you could not re-use the code, since the code does not work. But since you have the code working on one type, it is often trivial to re-use it on other types in the Ada programming lanaguage.