|
Am 28.08.2014 um 08:58 schröbte Coroutines:
On Wed, Aug 27, 2014 at 11:53 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:Neutral: Some of IPython's convenience comes from Python conventions we do not yet have in Lua, in particular its docstring.hmm. docstring = function (f, description) docstring_table[f] = description end debug.setmetatable(function () end, { __tostring = function (self) return rawstring(self), docstring_table[self] end }) -- or something fun...
If it's docstrings you want, there is nicer syntax for that here[1]. I have an implementation (mainly for typechecking)[2], and I also have started to document Lua's standard library[3] for interactive help but got bored -- I don't use the REPL very often. At least all function signatures should be there, though ...
Philipp [1]: http://lua-users.org/wiki/DecoratorsAndDocstrings [2]: https://github.com/siffiejoe/lua-annotate[3]: https://github.com/siffiejoe/lua-annotate/blob/master/src/annotate/help.lua