pike.git / lib / modules / Function.pmod

version» Context lines:

pike.git/lib/modules/Function.pmod:82:   function(mixed...:function(mixed...:mixed|void)) curry(function f)   {    return lambda(mixed ... args1) {    return lambda(mixed ... args2) {    return f(@args1, @args2);    };    };   }       + //! 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...:mixed) 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.   //!   //! @example   //! @code   //! Functions.call_callback(the_callback,some,arguments);   //! @endcode   //! equals   //! @code
pike.git/lib/modules/Function.pmod:106:   //! @endcode   //! (Approximately, since call_callback also calls handle_error   //! if 0 were thrown.)   void call_callback(function f,mixed ... args)   {    if (!f) return;    mixed err=catch { f(@args); return; };    handle_error(err);   }    - function handle_error = master()->handle_error; + private function handle_error = master()->handle_error;