comp.lang.ada
 help / color / mirror / Atom feed
* generic imports?  void* -> generics?
@ 2003-09-19 19:20 chris
  2003-09-19 20:46 ` chris
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: chris @ 2003-09-19 19:20 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-09-24 18:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19 19:20 generic imports? void* -> generics? chris
2003-09-19 20:46 ` chris
2003-09-19 21:18 ` Nick Roberts
2003-09-19 23:12   ` chris
2003-09-20 16:52   ` Simon Wright
2003-09-22 21:30     ` Randy Brukardt
2003-09-23  5:45       ` Simon Wright
2003-09-23 19:07         ` Randy Brukardt
2003-09-23 20:28           ` Simon Wright
2003-09-24 18:16             ` Randy Brukardt
2003-09-19 22:40 ` Matthew Heaney
2003-09-19 23:01   ` chris
2003-09-20  1:59   ` Jeffrey Carter
2003-09-20 13:52     ` Matthew Heaney
2003-09-23 22:39 ` chris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox