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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.129.139 with SMTP id nw11mr11806295pab.35.1406402464403; Sat, 26 Jul 2014 12:21:04 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h18no8175441igc.0!news-out.google.com!j6ni17450qas.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 26 Jul 2014 14:21:04 -0500 Date: Sat, 26 Jul 2014 15:21:03 -0400 From: Peter Chapin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: If a routine should return two results, how should it be done? References: In-Reply-To: Message-ID: <98ydnZoYn_c9Yk7O4p2dnAA@giganews.com> X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-IaHNuuv+euFXuP+ZoEl8P7u+foZQGiQTNcS5TYMn10ylhuf01+hw0iWbRi2EldaFCFAMLdrwP617F3+!4cMqdma1v+mXqx3clZWqckGPNc4BF/3Od+DfE4xnlnxsIYRBBNFeiDy7fI7Nzuc= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2606 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Xref: news.eternal-september.org comp.lang.ada:21262 Date: 2014-07-26T15:21:03-04:00 List-Id: 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