lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



--- El mar 6-dic-11, Tim Caswell <tim@creationix.com> escribió:

> De: Tim Caswell <tim@creationix.com>
> Asunto: Re: How to properly initialize a module?
> Para: "Lua mailing list" <lua-l@lists.lua.org>
> Fecha: martes, 6 de diciembre de 2011, 16:26
> I think stock lua's require allows
> this and I know I do in Luvit, but
> often I'll make the module itself be a function instead of
> a table.
> Then it would be
> 
> local Canvas = require('canvas')
> local canvas = Canvas('/dev/fb0')

How would this be implemented from C-side?