![](https://secure.gravatar.com/avatar/8a1ca9f288a1644e9e07d7f11d2f494c.jpg?s=120&d=mm&r=g)
Hey folks, Anyone else really wish that Chuck supported higher order functions??? check it out. This doesn't work, but i'd love for it to work: // a function that returns an int fun int fn( int n ) { return n + 3; } // a function that takes a function and an array of ints // and returns an array of ints which correspond to the action // of that function on each int in the original array fun int[] mapInt( function fn, int list[] ) { int results[list.cap()]; for( 0 => int i; i < list.cap(); i++ ) { fn( list[i] ) => results[i]; } return results; } [1, 2, 3, 4, 5] @=> input; Add3 add3; mapInt( add3, input ) => int output[]; <<< output[2] >>>; // should print 6 -- I just wish that functions could take other functions as parameters and return functions as their return value. I think that would make sense. Functions, I find are more powerful than classes in Chuck. Also, why is "function" a keyword? cheers, mike -- http://semiotech.org http://deadlylittlepills.com/michael