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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9fdb4e673a488b12 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-08 10:46:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3DF39358.1020903@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Placement of pragma Import References: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 08 Dec 2002 18:44:54 GMT NNTP-Posting-Host: 63.184.104.172 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1039373094 63.184.104.172 (Sun, 08 Dec 2002 10:44:54 PST) NNTP-Posting-Date: Sun, 08 Dec 2002 10:44:54 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:31555 Date: 2002-12-08T18:44:54+00:00 List-Id: Michal Nowak wrote: > Hello all, > > I have a little question coming out of curiosity. > > I have an assembly routine (in fact it may be a C code, > or something other, it does not matter). > I'm importing this subroutine in a package. It is possible > to place pragma Import in two (maybe more?) places: > > -- Possibility 1: > > package Import_Test is > > procedure Asm_Coded; > > pragma Import (Assembler, Asm_Coded, "donothing"); > pragma Linker_Options ("nothing_asm.s"); > > end Import_Test; > > -- Possibility 2: > package Import_Test is > > procedure Asm_Coded; > > private -- Imported in private section > > pragma Import (Assembler, Asm_Coded, "donothing"); > pragma Linker_Options ("nothing_asm.s"); > > end Import_Test; > As far as I can see, it makes absolutely no difference. Things in the private part are not visible to clients in the Ada sense, but clients cannot refer to the pragmata even if they are visible. The human reader can see the private part, so putting them there does not hide them in any way. If you could put them in the body, that would hide them from the human reader, who should only have to refer to the spec to learn what the package does and how to use it. But you can't do that, so it seems to make no difference at all. Perhaps putting them in the private part will signal to human readers that the information is not needed to understand the package. That is the only reason I can see to prefer one over the other. -- Jeff Carter "Death awaits you all, with nasty, big, pointy teeth!" Monty Python & the Holy Grail