Quantcast
Channel: Addons from WowAce.com
Viewing all articles
Browse latest Browse all 2479

LibFunctional-1.0

$
0
0

Library of helper functions that enable functional style programming and perform commonly used operations on lists and tables.

Example:

localfn=LibStub("LibFunctional-1.0")locallist={1,2,3,4,5}-- returns a list with the result of applying the specified function to all the values in the listlocalmapped=fn.map(list,function(x)returnx*2end)-- returns the product of all the values in the listlocals=fn.reduce(mapped,function(a,b)returna*bend)-- prints a sorted list of all the names of global variables that match "CHAT_FRAME"localaddmessage=fn.bind(DEFAULT_CHAT_FRAME.AddMessage,DEFAULT_CHAT_FRAME)fn.each(fn.sort(fn.filter(fn.keys(_G),function(x)returnstring.match(x,"CHAT_FRAME")end)),addmessage)

See the API page for more details.


Viewing all articles
Browse latest Browse all 2479