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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Intermixing two tagged types Date: Wed, 13 Aug 2014 23:32:15 +0300 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188438 Date: 2014-08-13T23:32:15+03:00 List-Id: I am implementing thick Ada2012 bindings for http://librdf.org/raptor/api/raptor2-section-xml-namespace.html This documentation defines two types: raptor_namespace and raptor_namespace_stack. Methods for these types are essentially C functions whose name start with raptor_namespace_ raptor_namespaces_ correspondingly. Now to the trouble (or rather a problem): Some of these functions accept only one the two types: raptor_namespace or raptor_namespace_stack. But there are functions (let's call them "suspicious functions") which accept both raptor_namespace or raptor_namespace_stack types as its arguments. To make things worse, some of suspicious functions have raptor_namespace_ and some raptor_namespaces_ prefix. So (now in Ada terms, which I am implementing) a function can belong to two tagged types. How to formalize this in Ada? I see two variants: 1. Put them into two different packages and do "limited with" from each of the two packages to the other one. 2. Make all suspicious functions belonging to one certain Ada package (which of the two?) I could both types into the same package, but this causes troubles described in comp.lang.ada topic. Please give a good advise what to do in this situation. -- Victor Porton - http://portonvictor.org