Created
May 25, 2013 10:17
-
-
Save Tyderion/5648602 to your computer and use it in GitHub Desktop.
Map/Reduce for autohotkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map(array, function, otherparams*) | |
{ | |
if (function.name == "") | |
function := Func(function) | |
returnarray := [] | |
For index, value in array | |
returnarray[index] := function.(value, otherparams*) | |
return returnarray | |
} | |
reduce(array, functino, otherparams*) | |
{ | |
accumulator := "" | |
if (function.name == "") | |
function := Func(function) | |
For index, val in array | |
{ | |
accumulator := function.(accumulator, val, otherparams*) | |
} | |
return accumulator | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment