Main menu:

Site search


RSS Arjen's Friendfeed

RSS Richard's links

RSS Maurits' Stumbled Items

Archive for September, 2009

Curry: partial functions in Actionscript 3

I needed curry() and bind() in Actionscript 3, because I was porting a Javascript application that was built using PrototypeJS 1.6 to Flex and the application heavily used these functions. I came up with the following Actionscript / Flex code: package { public function bindAndCurry(…a):Function { return function(…b):* { return a.shift().apply(a.shift(), a.concat(b)) } } } package { import flash.display.Sprite; […]