Call a function: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: add Version 2)
m (→‎{{header|Nemerle}}: corrected partial application example)
Line 728: Line 728:
// partial application
// partial application
def f(a, b) { ... }
def f(a, b) { ... }
def g = f(2) // g is a function of one argument
def g = f(2, _)
def a = g(2) // equivalent to: def a = f(2, 2)</lang>
def h = f(_, 2)
def a = g(3) // equivalent to: def a = f(2, 3)
def b = h(3) // equivalent to: def b = f(3, 2)</lang>


=={{header|OCaml}}==
=={{header|OCaml}}==