Branch: Tag:

2014-09-03

2014-09-03 18:30:32 by Per Hedbor <ph@opera.com>

Added Function.uncurry. It is sort of the reverse of Function.curry.

89:   }       + //! This function, given a function taking N parameters, returns a new + //! function taking N+1 parameters. The first argument will be + //! ignored. + //! + //! @example + //! @code + //! > Function.uncurry(`+)(7,2,3) + //! Result: 5 + //! @endcode + function(mixed...:function(mixed...:mixed|void)) uncurry(function f) + { +  return lambda(mixed ... args1) { +  return f(@args1[1..]); +  }; + } +    //! Call a callback function, but send throws from the callback   //! function (ie, errors) to master()->handle_error.   //! Also accepts if f is zero (0) without error.
113:    handle_error(err);   }    - function handle_error = master()->handle_error; + private function handle_error = master()->handle_error;