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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-19 13:42:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-winn.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: Re: generic imports? void* -> generics? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 19 Sep 2003 21:46:28 +0100 NNTP-Posting-Host: 81.98.236.164 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-winn.server.ntli.net 1064004119 81.98.236.164 (Fri, 19 Sep 2003 21:41:59 BST) NNTP-Posting-Date: Fri, 19 Sep 2003 21:41:59 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:42697 Date: 2003-09-19T21:46:28+01:00 List-Id: Another problem is that in this case the void* is a pointer to some data block... but if we define the following with Lua_Types; use Lua_Types; generic type Userdata is private; type Userdata_Access is access all Userdata; function Lua.To_Userdata (L : in Lua_State_Access; Pos : in Index) return Userdata_Access; what will the interaction be with the c code? It's not possible afaik to define the convention of Userdata_Access to C. Can anyone please help? I'm not really sure what the solution should be... http://www.lua.org/manual/5.0/manual.html#3.8 describes the operation of this function ... "lua_touserdata (see 3.5) retrieves the value of a userdata. When applied on a full userdata, it returns the address of its block; when applied on a light userdata, it returns its pointer; when applied on a non-userdata value, it returns NULL."