On 27 August 2013 05:06,  <[email protected]> wrote:
> Greetings.
>
> I've had an uncomfortably long break from writing in Lua, largely
> because of Perl's CPAN module Term::ReadKey
>   http://search.cpan.org/perldoc?Term::ReadKey
> for which I haven't noticed a Lua equivalent (so that's the first
> question: are there already Lua equivalents for ReadMode(), ReadKey()
> and GetTerminalSize() that I missed ?);

Not exactly sure what those do, but I guess you could have equivalent
functionality from the curses module from luaposix?... (or, looking at
the rocks repo, perhaps ltermbox)

> So I've started to do a Lua translation of Term::ReadKey.  To get its
> portability, Term::ReadKey comes with a behind-the-scenes system-explorer
>   http://search.cpan.org/dist/TermReadKey/Configure.pm
> which is invoked by genchars.pl
>   http://cpansearch.perl.org/src/STSI/TermReadKey-2.30.02/genchars.pl
> to generate a custom cchars.h header at build time.
> Translating Configure.pm and genchars.pl is more than I bargained for,
> so now I've got questions like:
>
>  Is any of this  Configure.pm  functionality already in luarocks?

No, there is no autoconf-style functionality to detect symbols and
perform any detection more advanced than trying to find library files
and headers.

>  Is is acceptable to depend on Perl during a luarocks install,
>    and run genchars.pl and Configure.pm more or less as they are?

Well, that's more up to users of your module. On Linux systems Perl is
usually present anyway so most users won't even notice the dependency.
You'd probably have to use build.type="make" and write a Makefile that
performs the steps. Perhaps you could ship a reasonable default
cchars.h header for when it can't be built for some reason?

>  The function names offered by the Term::ReadKey module are capitalised
>    (eg: ReadMode()) which is not my habit, but I would like to make
>    my readkey.lua as calling-interface-compatible as possible;
>    are capitalised function names OK in a luarocks module ?

There are no restrictions or conventions concerning the actual APIs
exported by LuaRocks. We try to avoid conflicts in the namespace of
rocks, but there's no checking of conflicts or rules for module or
function names (and there are no official Lua conventions for those).

-- Hisham

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to