Currying: Difference between revisions
Content added Content deleted
m (whitespace tweaks) |
(→Tcl: Added description) |
||
Line 198: | Line 198: | ||
<lang scheme>>((curry + 10) 10) |
<lang scheme>>((curry + 10) 10) |
||
20</lang> |
20</lang> |
||
=={{header|Tcl}}== |
|||
The simplest way to do currying in Tcl is via an interpreter alias: |
|||
<lang tcl>interp alias {} addone {} ::tcl::mathop::+ 1 |
|||
puts [addone 6]; # => 7</lang> |
|||
Tcl doesn't support automatic creation of curried functions though; the general variadic nature of a large proportion of Tcl commands makes that impractical. |