In Coldfusion 10 and Railo 4, you can create composite functions using the Underscore.cfc library :
_ = new Underscore();// instantiate the library f1 = function (message) { return "hello " & message; }; f2 = function (toOutput) { writeOutput(toOutput); }; sayHelloTo = _.compose(f2, f1); sayHelloTo("world!");// output: "hello world!"
(Note: I wrote the Underscore.cfc library)
source share