-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
14 lines (10 loc) · 1.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Komeetta is project containing a functional-style list and list functions in Lua. Perhaps in the future it will contain other functional stuff as well. The word "komeetta" is Finnish and means "comet", but because that word is already used in another Lua project I decided to use the Finnish translation. "Comet" is a good word for a list implementation because a comet has a head and a tail.
Usage:
require("komeetta")
list = komeetta.List:new(5, -3, 1) -- (5 -3 1)
sorted_list = list:sort() -- (-3 1 5)
None of the functions will modify the original collection. So you can safely chain them together like this:
...
komeetta.List:new(5, -3, 1):sort():reverse() -- (5 1 -3)
To run the tests you will need luaspec (http://github.com/mirven/luaspec). The specs presume you have installed luaspec via luarocks, if this is not the case then you need to modify the "require"-statements in the specs. Once everything is set you need to run the "run_specs"-file.
I would really like to have something similar to Maven in the Lua world.