[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: External modules was Re: Ideas for implementing commercial support for Lua
- From: Ignacio Castaño <castanyo@...>
- Date: Mon, 18 Nov 2002 20:10:00 +0100
Roberto Ierusalimschy wrote:
> Currently, our idea is to put the minimum in C, and everything else in
> Lua. Typically, each module in C would have a companion file in Lua:
> this Lua file could be very small, more or less like this:
>
> -- Lua file for module Xuxu: xuxu.lua
> -- Config part; set to your system
> local libdir = "/usr/local/lua/"
> local modname = "xuxu.so"
>
> local f = loadlib(libdir..modname, "xuxuopen")
> if not f then error (...) end
> f() -- open module
>
> You put xuxu.so anywhere, adjust xuxu.lua, and put xuxu.lua in a
> directory on your LUA_PATH; than you use it as
>
> require "xuxu"
>
> For the user, it doesn't matter whether this is a C module or a Lua
> module (or a mixed one).
Ok, I see, that's fine then!
I'm eager to start seen extension modules distributed that way.
Ignacio Castaño
castanyo@yahoo.es
_______________________________________________________________
Copa del Mundo de la FIFA 2002
El único lugar de Internet con vídeos de los 64 partidos.
¡Apúntante ya! en http://fifaworldcup.yahoo.com/fc/es/