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,72137304956d9360,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-19 12:15:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: chris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: generic imports? void* -> generics? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 19 Sep 2003 20:20:18 +0100 NNTP-Posting-Host: 81.98.236.164 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1063998949 81.98.236.164 (Fri, 19 Sep 2003 20:15:49 BST) NNTP-Posting-Date: Fri, 19 Sep 2003 20:15:49 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:42695 Date: 2003-09-19T20:20:18+01:00 List-Id: Hi, Should the following C code be mapped to a generic? void *lua_touserdata (Lua_State* L, int pos) I was thinking of something like generic type Userdata is private; function to_userdata (L : in Lua_State_Access; Pos : in Index) return Userdata; but am unsure how to complete it... I tried function To_Userdata (L : in Lua_State_Access; Pos : in Index) return Userdata is function Lua_ToUserData (L : in Lua_State_Access; Pos : in Index) return Userdata; pragma Import (C, Lua_ToUserData); begin return Lua_Touserdata (L, Pos); end To_Userdata; and it compiles ok, but is it right? It looks odd to me. Will the function Lua_ToUserData be imported upon instantiation of the To_Userdata function? Cheers, Chris