lua-users home
lua-l archive

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


PiL talks about a style of data description that looks like:

entry {
    title='xxx',
    url="">
}

http://www.lua.org/pil/10.1.html

If I wanted to use this, and wanted entry to be a module, could I just make a module that returns a function instead of a table?

local entry = require 'entry'
should still work.

I don't care about anything like being able to call entry.someFunc.

Is a module that is a function (not a table) a reasonable thing? Is it a common idiom (in this case)? Are there alternatives?

Appreciate feedback.