pike.ida.liu.se
Search for
Home > Docs > Pike reference

[Top]
Function

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)

Module reference for Pike v7.8 release 116, 2008-12-31