Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Function-composition/Tcl/function-composition.tcl
Normal file
10
Task/Function-composition/Tcl/function-composition.tcl
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package require Tcl 8.5
|
||||
namespace path {::tcl::mathfunc}
|
||||
|
||||
proc compose {f g} {
|
||||
list apply [list {f g x} {{*}$f [{*}$g $x]}] $f $g]
|
||||
}
|
||||
|
||||
set sin_asin [compose sin asin]
|
||||
{*}$sin_asin 0.5 ;# ==> 0.5
|
||||
{*}[compose abs int] -3.14 ;# ==> 3
|
||||
Loading…
Add table
Add a link
Reference in a new issue