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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5a84d5077c54a29d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!out02a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada array vs C pointer (call by reference) References: <5df91e99-a972-48f7-b466-3eb05dc0a915@m3g2000hsc.googlegroups.com> From: Stephen Leake Date: Sat, 28 Jun 2008 10:02:48 -0400 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:aNfeq/sSbcM8guofoPwrlKxiCBw= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 943e748663ebdc74cf8ca14505 Xref: g2news1.google.com comp.lang.ada:935 Date: 2008-06-28T10:02:48-04:00 List-Id: Robert A Duff writes: > Keith Thompson writes: > >> Interfaces.C.C_Float, which (assuming the Ada implementation gets it >> right), is guaranteed to match C's float, or of using Float, which has >> no such guarantee (but saves a little typing). Why would you even >> consider using Float? > > You might have a program that uses Float all over the place, > and you want to add some interface to C in one tiny corner > of that program. You might be tempted to use Float at the > interface to C in order to avoid a lot of type conversions. A better way to avoid a lot of type conversions is to provide a thin C interface using Interfaces.C.C_Float, and a thin Ada wrapper that does the type conversion to Ada.Float (or some other user provided type). -- -- Stephe