lua-users home
lua-l archive

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


On Tue, Aug 13, 2013 at 9:01 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
2. Context-dependent name completion (`lua` with 'readline' does it
   for file names only.

My favourite tactic here is to use lua-linenoise, which comes with the linenoise source; linenoise has a liberal licence, unlike readline. Both with luaish and now with mooni, this is used for name completion. Some basic context-sensitive is available, like if s is a global string, then s:gs <tab> becomes s:gsub.  (We cannot use partial evaluation of more complex expressions because there can always be side-effects)

luaish is somewhat ... eccentric.  It can also be used as a shell prompt (lines begining with '.') where it shifts to file name completion, and there are some experimental features for passing data between Lua and the shell. But it's basically a Lua REPL with name completion, saved history and an optional initialization config file.

3. One-keystroke help (e.g. '?coroutine') for all keywords and standard
   libraries, and a well-defined mechanism for providing that with
   modules.

This ends up being the tricky bit, but you did some interesting work in that direction..... the most common kind of module documentation is LuaDoc style[1] - it would need to scrape such comments (and cache) to supply interactive docs. (ldoc itself is too heavyweight a dependency)   Binary modules would need to provide a .luadoc file.
 
4. Installing it must be no harder than compiling `lua`. I.e. type
   `make linux`, `make mingw` or whatever in the directory in which
   the distribution is unpacked, and NO DEPENDENCIES.

Why not let a package manager like dpkg or LuaRocks handle the details?

steve d.

[1] at minimum: a function comment starting with more than two hyphens followed by a sentence.

Ldoc ships with such minimal documentation, borrowed from mitchell's excellent Textadept project

https://github.com/stevedonovan/LDoc/blob/master/ldoc/builtin/coroutine.lua