RosettaCodeData/Task/Currying/Io/currying.io
2026-02-01 16:33:20 -08:00

12 lines
240 B
Io

curry := method(fn,
a := call evalArgs slice(1)
block(
b := a clone appendSeq(call evalArgs)
performWithArgList("fn", b)
)
)
// example:
increment := curry( method(a,b,a+b), 1 )
increment call(5)
// result => 6