comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Chapin <PChapin@vtc.vsc.edu>
Subject: Re: If a routine should return two results, how should it be done?
Date: Sat, 26 Jul 2014 15:21:03 -0400
Date: 2014-07-26T15:21:03-04:00	[thread overview]
Message-ID: <98ydnZoYn_c9Yk7O4p2dnAA@giganews.com> (raw)
In-Reply-To: <lr0tn4$d71$1@speranza.aioe.org>

On 2014-07-26 14:57, Victor Porton wrote:

> I want to create a thick Ada binding for the following C function:
> 
> http://librdf.org/raptor/api/raptor2-section-uri.html#raptor-uri-uri-string-to-filename-fragment
> 
> char *              raptor_uri_uri_string_to_filename_fragment
>                                                         (const unsigned char *uri_string,
>                                                          unsigned char **fragment_p);
> 
> Which variant is better for this specific case: 1 or 3?

If you're creating a thick binding you don't need to limit yourself to
the same collection of functions provided by the underlying library.
You're in a position to define the types abstractly and write
subprograms that expose the needed functionality without regard to the
specific underlying functions.

I would expect a thick binding to merely use the underlying library to
implement a higher level (cleaner, more abstract) interface. It's not
about providing a binding to each underlying function one-to-one. That's
a thin binding.

What I'm talking about is more work because you'll have to do some
designing. It also comes with a larger documentation effort because
users of your binding won't be able to just read the underlying
library's documentation. But that's what thick bindings are all about.
That's what makes them better. :)

Peter



  reply	other threads:[~2014-07-26 19:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-26 18:00 If a routine should return two results, how should it be done? Victor Porton
2014-07-26 18:53 ` Niklas Holsti
2014-07-26 18:57   ` Victor Porton
2014-07-26 19:21     ` Peter Chapin [this message]
2014-07-26 19:37       ` Dan'l Miller
2014-07-26 20:10     ` Shark8
2014-07-26 20:42 ` Victor Porton
2014-07-26 20:44   ` Victor Porton
2014-07-27 11:59 ` anon
replies disabled

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