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-Thread: 103376,8e7ac81a215f128c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Using Red-Black Trees Date: Thu, 18 Nov 2010 13:36:57 +0100 Organization: Adalog Message-ID: References: <2419e829-6f45-4075-9005-b9876beb8aaa@r6g2000vbf.googlegroups.com> <46306fd9-21dc-40df-88e7-fc7e568399a4@k11g2000vbf.googlegroups.com> <1g4kzlu0ma9k7$.1t1gq0uvi1a5y.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 18 Nov 2010 12:37:04 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="vslmL83UgSXHD8TS0/yPxA"; logging-data="7465"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/aPGp8SxrRxZ5WrdgADth" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 In-Reply-To: <1g4kzlu0ma9k7$.1t1gq0uvi1a5y.dlg@40tude.net> Cancel-Lock: sha1:sRzVZtL3F1AlgkYhJHJ219GqSB8= Xref: g2news2.google.com comp.lang.ada:16553 Date: 2010-11-18T13:36:57+01:00 List-Id: Le 18/11/2010 10:02, Dmitry A. Kazakov a �crit : >> Provide two packages with identical (or compatible enough for your >> purpose) specifications: >> >> package Binary_Tree is.... >> package Linked_List is.... >> >> Then declare at library level: >> with Binary_Tree; >> package My_Structure renames Binary_Tree; > > Yes of course it is a simple, but non-Ada solution. BTW, I am using it for > years, with a small addition that the implementation is selected by the > gpr-file. > > But it is not Ada it is pure C, because nothing is checked. Come on, any incorrect usage will not compile! You may argue that it would be nice to check that both structures are compatible, but I challenge you to define the compatibility rules for packages. In practice, two packages are compatible if the *user* uses only compatible subprograms from both... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00