[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Penlight library
- From: Andrew Starks <andrew.starks@...>
- Date: Fri, 4 Oct 2013 18:05:07 -0500
On Friday, October 4, 2013, Andre Arpin wrote:
Andrew Starks <andrew.starks <at> trms.com> writes:
> Hello Andre,
>
> pl.lua is part of the Penlight library, as Pierre linked to.
>
> As it appears that you are new to Lua, I would suggest downloading the
> `luarocks` library that you asked about. It is designed to automate
> the installation of libraries and you will probably find that helpful.
> It is not required, however.
>
> http://luarocks.org/
>
> Another option is to look at LuaDist:
>
> http://luadist.org/
>
> This will automate things even further, and might be of some
> additional help, as you play around with Lua.
>
> --Andrew
>
> Since lua is already installed, luarocks
>
>
Ok:
I downloaded Penlight-master unzip it.
there is no pl.lua in this zip file.
Shouldn't they be one somewhere.
Andre
Not necessarily. Lua follows a search patten when looking for libraries that are loaded with require. This pattern allows for organization such as:
pl/init.lua
You must put the entire pl directory into the module path for lua. To learn what that is on your machine, you can run lua in your command prompt / terminal program and type:
=package.path
It will print out some file paths in a list, separated by ";". You will see some like this:
"C:/lua/5.2/?.lua;C:/lua/?/init.lua"
Pick whichever path seems most simple to you and copy the "pl" directory into that. Using my example, you should have a path like:
"C:/lua/5.2/pl"
As I said, however, LuaDist may be a simpler way to start with Lua, as it simplifies this process and will properly install the documentation, as well. Also, other libraries that need installation are more involved than Penlight.
Let me know if I can help further!
-Andrew