Skip to content

Instantly share code, notes, and snippets.

@bittersweetryan
Created October 4, 2012 18:27
Show Gist options
  • Save bittersweetryan/3835464 to your computer and use it in GitHub Desktop.
Save bittersweetryan/3835464 to your computer and use it in GitHub Desktop.
partial application
<cfscript>
test = new test();
addOne = test.makeAdder(1);
addFive = test.makeAdder(5);
writeOutput( addOne( 1 ) ); //2
writeOutput( addOne( 2 ) ); //3
writeOutput( addFive( 1 ) ); //6
writeOutput( addFive( 2 ) ); //5
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment