lua-users home
lua-l archive

Re: Lua as Configuration Conditional Statement inside table definition

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


> function conditional(test)
> function add(item) return item end
> function discard() return nil end
> if test then return add end
> return discard
> end
This pollutes the global namespace and creates add and discard each time
it is called.

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