lua-users home
lua-l archive

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


--- El mar 6-dic-11, Rob Hoelz <rob@hoelz.ro> escribió:

> De: Rob Hoelz <rob@hoelz.ro>
> Asunto: Re: How to properly initialize a module?
> Para: lua-l@lists.lua.org
> Fecha: martes, 6 de diciembre de 2011, 16:41
> That's kind of a neat idiom; you
> could easily then do something like
> this:
> 
> local canvas = require 'canvas' '/dev/fb0'
> 
> or even this:
> 
> local canvas = require 'canvas' {
>   device = '/dev/fb0'
> }

I am confused about this. Is this valid syntax?

How would I implement from C side? What's the difference between
require 'foo'.func() and require 'foo' 'bar' ?

Thanks.