| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]
Function

# Method Function.curry()

Method curry

  `function curry(function f)`

Description

  Partially evaluate a function call.

  This function allows N parameters to be given to a function taking M parameters (N<=M), yielding a new function taking M-N parameters.

  What is actually returned from this function is a function taking N parameters, and returning a function taking M-N parameters.

Example

      This example creates a function adding 7 to its argument.

  Function.curry(`+)(7)