Skip to content

Instantly share code, notes, and snippets.

@Tyderion
Created May 25, 2013 10:17
Show Gist options
  • Save Tyderion/5648602 to your computer and use it in GitHub Desktop.
Save Tyderion/5648602 to your computer and use it in GitHub Desktop.
Map/Reduce for autohotkey
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