comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Intermixing two tagged types
Date: Wed, 13 Aug 2014 23:32:15 +0300
Date: 2014-08-13T23:32:15+03:00	[thread overview]
Message-ID: <lsgi0c$q2j$1@speranza.aioe.org> (raw)

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 <Trouble with "operation can be dispatching in only one type"> 
comp.lang.ada topic.

Please give a good advise what to do in this situation.

-- 
Victor Porton - http://portonvictor.org


             reply	other threads:[~2014-08-13 20:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 20:32 Victor Porton [this message]
2014-08-14  7:58 ` Intermixing two tagged types Simon Wright
2014-08-14 11:57   ` Victor Porton
2014-08-14 12:06     ` Dmitry A. Kazakov
2014-08-14 16:03     ` Adam Beneschan
2014-08-14 16:11       ` Victor Porton
2014-08-14 16:29         ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox