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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1533431e7e9d2eb X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: Nontrivial examples of C interface with Ada Date: 2000/05/29 Message-ID: <3931C2D9.36F9480A@research.canon.com.au>#1/1 X-Deja-AN: 628430194 Content-Transfer-Encoding: 7bit References: <9ckmisoo8k0dh1gcajhdgqtqjqc3bjmb25@4ax.com> <8ghbqc$ram$1@nnrp1.deja.com> <392CC733.13BDDC84@quadruscorp.com> <8gjjeb$eng$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@research.canon.com.au X-Trace: cass.research.canon.com.au 959562411 12113 203.12.174.227 (29 May 2000 01:06:51 GMT) Organization: Canon Information Systems Research Australia Mime-Version: 1.0 NNTP-Posting-Date: 29 May 2000 01:06:51 GMT Newsgroups: comp.lang.ada Date: 2000-05-29T01:06:51+00:00 List-Id: Ted Dennison wrote: > But somtimes you can go the other way. I often turn what was basicly > a "procedure with return error code" interface into a "function that > raises exception on error" interface. > > Its funny how a mid-thick binding with exceptions can make a C library > routine easier to use in Ada than C. :-) There are good examples of this in my binding to JNI. In C you have to do a test to see if a Java exception has been thrown. The Ada binding just raises an exception.