lua-users home
lua-l archive

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

On 13/06/2011 12.46, steve donovan wrote:
On Mon, Jun 13, 2011 at 12:25 PM, Lorenzo Donati
<>  wrote:
It seems that ldoc cannot automatically infer the following styles of
function declarations inside a (new-style) module:

-- style 1
local function M_MyFunc(x)
M.MyFunc = M_MyFunc

Very true - I made the decision not to consider local functions to be
'documentable', although this is probably too restrictive.

Besides the function definition style recognition, I thing that making local function (and other locals, too) "documentable" should be allowed.

Of course not for building API documentation, but for "in-house" documentation. Sometimes it happens that a long module has to be refactored/changed/extended and some of its "private" local functions are to be reused (or made public). It is useful to be able to have some doc pages for that, because it avoids browsing the source until you really have to touch that source.

For example, imagine you remember having written some utility function for, say, splitting a string in a special way, but only for a module's internal use. Then after some months you need that algorithm again and you vaguely remember to have done that already, but don't remember where and when. Having doc pages for "internal stuff" could avoid time wasting searches.


-- Lorenzo