Jump to content

Currying: Difference between revisions

325 bytes added ,  6 years ago
added Ceylon
(added Ceylon)
Line 188:
=={{header|C++}}==
Currying may be achieved in [[C++]] using the [[wp:Standard Template Library|Standard Template Library]] function object adapters (<code>binder1st</code> and <code>binder2nd</code>), and more generically using the [[wp:Boost library|Boost]] <code>bind</code> mechanism.
 
=={{header|Ceylon}}==
{{trans|Groovy}}
<lang ceylon>shared void run() {
function divide(Integer x, Integer y) => x / y;
value partsOf120 = curry(divide)(120);
print("half of 120 is ``partsOf120(2)``
a third is ``partsOf120(3)``
and a quarter is ``partsOf120(4)``");
}</lang>
 
=={{header|Clojure}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.