lua-users home
lua-l archive

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


On Fri, Oct 19, 2012 at 2:53 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2012/10/18 Rob Hoelz <rob@hoelz.ro>:
>
>>>
>>> https://github.com/downloads/hoelzro/lua-repl/lua-repl-0.3.tar.gz
>>>
>>> Please try it out and let me know what you think!
>>>
>
>> For those of you who don't know, lua-repl is a library for embedding a
>> Lua REPL (read-eval-print-loop) within another program.  It also
>> includes an example application named rep.lua, which is an alternative
>> to the standalone interpreter shipped with Lua itself.
>>
>
> I untarred the tarball and changed to its directory, did
> "sudo luarocks make luarepl-0.3-1.rockspec"  and tried "./rep.lua".

You shouldn't need to untar it yourself or use "luarocks make" (which
is mostly a development tool). Simply calling

   luarocks install luarepl

should download and install it properly.

> It worked after the following tweaks.
>
> 1. Change the first line in rep.lua from
>     #!/usr/bin/env lua
> to
>     #!/usr/bin/env lua5.1

LuaRocks also installs a launcher for bin/ entries, and it takes care
of adding the proper call to the lua interpreter that it was
configured with, so no need to edit rep.lua.

In other words, don't use './rep.lua' from the tarball. This sequence
should work from a shell:

   luarocks install luarepl
   eval `luarocks path --bin`  # just in case it's not in your $PATH
   rep.lua

> 2. Symbolically link $PWD/repl to /usr/local/lib/lua/5.1 (the rock
> installs only /usr/local/lib/luarocks/rocks/luarepl/0.3-1/bin/rep.lua).

The rock does install all modules; Lua modules go to .../share/lua/5.1.

-- Hisham
http://hisham.hm/