comp.lang.ada
 help / color / mirror / Atom feed
* Intermixing two tagged types
@ 2014-08-13 20:32 Victor Porton
  2014-08-14  7:58 ` Simon Wright
  0 siblings, 1 reply; 7+ messages in thread
From: Victor Porton @ 2014-08-13 20:32 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-14 16:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 20:32 Intermixing two tagged types Victor Porton
2014-08-14  7:58 ` 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

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