Source

lua-functional /

Filename Size Date modified Message
2.2 KB
30.3 KB
4.3 KB
62.4 KB
25.1 KB
--[[-----------------------------------------------------------
README

The lua-functional library.
version 1.102
for Lua 5.2.0

Bo Waggoner

Modified: 2012-02-02

This software is free.
---------------------------------------------------------------


-- No installation required. To use in your program, put 'lua-functional.lua'
-- into the current directory, then use as follows:

lfunc = dofile('lua-functional.lua')    -- load the library into 'lfunc'

lfunc.foldl(lfunc.add,0,{3,8,6,2})      -- call some functions from lfunc


lfunc.loadglobally(lfunc)               -- load library into global namespace

zipwith(sub,ipairs,{10,9,8},{5,4,3})    -- now you can call functions directly


---------------------------------------------------------------


VERSION HISTORY

Version          Release Date    Tested with Lua version
1.102 (current)  2012-02-02      5.2.0
1.101            2012-02-02      5.2.0
1.1              2012-02-02      5.2.0
1.001            2011-09-30      5.1.4
1.0              2011-09-29      5.1.4

Changes:
1.102   -- renamed 'select' to 'choose' to avoid conflict with the built-in
           lua function
        -- renamed 'sel' to 'indicator' to correspond, and for clarity
        -- made range() a bit faster
        -- added another example: Levenshtein distance
1.101   -- slightly increased functionality of casef: predicates and results can
           now be of any type; if they are not functions, treat them as values;
           if they are functions, call them with the input arguments.
1.1     -- updated for Lua 5.2:
           -- removed 'pack' (use table.pack instead)
           -- implementation details: fixes relating to use of pack and arg
           -- updated lua-functional-test.lua for same issues
        -- increased functionality of 'casef': a result can now be true, false,
             or nil, or it may be a function of the arguments as previously
        -- increased functionality of 'range': can now be called with only
             one argument, in which case default start value is 1
1.001	fixed bug in apply where it would fail with table arguments
1.0 	first release

--]]-----------------------------------------------------------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.