lua-users home
lua-l archive

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


Hello fellow Lua users!

Do you like Python's docstrings or their Lua equivalent[1]?
Do you want your Lua function definitions to look like this ...

  example = annotate[=[
    This example function does something really useful.

    example( input [, flags, ...] ) ==> table        -- on success
                                    ==> nil, string  -- in case of error
        input: string/function   -- filename or function producing input
        flags: table             -- set of flags
        ...  : (table/string)*   -- more flags

    Some more text describing function `example` ...
  ]=] ..
  function( input, flags, ... )
    -- ...
  end

... to get type checking for function arguments and/or return values?
Then maybe this module is for you. You can get it at your nearest rocks server or on github[2], documentation is here[3], license is MIT.

  [1]:  http://lua-users.org/wiki/DecoratorsAndDocstrings
  [2]:  https://github.com/siffiejoe/lua-annotate/
  [3]:  http://siffiejoe.github.io/lua-annotate/

If you have a great new idea what to do with docstrings, annotate allows you to register callbacks to implement those ideas without conflicts.

/marketing mode off

Thx,
Philipp