lua-users home
lua-l archive

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


> So I implemented something like this:
> 
>   require 'canvas'
>   canvas.init('/dev/fb0') 
>   -- canvas usage

To make it prettier, export a function

	function canvas.with(options)
		canvas.init(options)
		return canvas
	end

and use it as

	local canvas = require'canvas'.with'/dev/fb0'
	-- canvas usage