Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Function currying


Published on

Understanding and using Function Currying for AS3 and javascript developers.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Function currying

  1. 1. Understanding Function Currying Javascript / AS3 Thomas Burleson Digital Solutions ArchitectSunday, April 29, 12
  2. 2. Anonymous Functions Closures Function Currying Partial ApplicationsSunday, April 29, 12
  3. 3. Function Currying: Combine function with variables to create new function. Variables are cached [captured] as function arguments Outer variables are accessed via closure scope by inner FunctionSunday, April 29, 12
  4. 4. But how/why do we use Function Currying Explore existing Javascript code Refactor code (to remove verbosity) Apply DRY concept Concise Code, Easy MaintenanceSunday, April 29, 12
  5. 5. Refactoring with DRY Existing Code Anonymous Functions Closures Function CurryingSunday, April 29, 12
  6. 6. REST Service (asynchronous)Sunday, April 29, 12
  7. 7. Not DRY Verbose! Difficult to maintainSunday, April 29, 12
  8. 8. Uses function currying at two (2) levels : onSuccess() forClass()Sunday, April 29, 12
  9. 9. Video Tutorial (click to run) (click to download) Source CodeSunday, April 29, 12