lua-users home
lua-l archive

Re: Modules, interafaces

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


> ---------------------------------
> M.wonder = function(s)     --M from above
>        return aux(s).."?" --aux from above
> end
> ---------------------------------
By putting "?" into M or by implementing get function to access upvalue(s).
Sometimes implementing set/get pair for every piece of data is worth it anyway
(e. g., in widget system), sometimes it's just an overhead.
Several upvalues may be packed into single table like:
 M.private = {a = b, c = d, e = f}
or accessed by single function:
 function M.get_stuff ()
 return b, d, f
 end

AltStyle によって変換されたページ (->オリジナル) /