Jump to content

Currying: Difference between revisions

add swift
(add picolisp)
(add swift)
Line 566:
<lang scheme>>((curry + 10) 10)
20</lang>
=={{header|Swift}}==
{{trans|JavaScript}}
<lang Swift>func addN(n:Int) -> ((Int) -> Int) {
func curry(x:Int) -> Int {
return x + n
}
return curry
}
 
var add2 = addN(2)
println(add2) // (Function)
println(add2(7)) // 9</lang>
 
=={{header|Standard ML}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.