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,9b05d372d1b25f25 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.250.MISMATCH!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Interfacing to C and types visible to Ada Date: Thu, 03 Jul 2008 10:33:51 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1215095632 6132 192.74.137.71 (3 Jul 2008 14:33:52 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 3 Jul 2008 14:33:52 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:x3J7spdw8QvsP8q6Y+dAJrokHtk= Xref: g2news1.google.com comp.lang.ada:994 Date: 2008-07-03T10:33:51-04:00 List-Id: Maciej Sobczak writes: > We can use Interfaces.C.int for binding Ada to C, but there is still a > need to expose somehow the type to regular Ada code. What type should > be used? You can do one of: subtype Int is Interfaces.C.int; -- rename the type type Int is new Interfaces.C.int; -- declare a new type > The Ada wrapper library might also define its own type that will be > equivalent in range to Interfaces.C.int. What is the right name for > such a type? I don't know, but Integer is not a good choice, IMHO. If you have: package My_Binding is type Integer is ... then inside My_Binding (including its children), that Integer will hide the one in Standard. In other packages that say "use My_Binding;", the Integer in Standard will hide the one in My_Binding. You will be continually confused about which Integer you are referring to. And people who are familiar with Ada, but not familiar with My_Binding will be even more confused. - Bob