Add all the A tasks
This commit is contained in:
parent
2dd7375f96
commit
051504d65b
1608 changed files with 18584 additions and 0 deletions
8
Task/Anonymous-recursion/Tcl/anonymous-recursion-4.tcl
Normal file
8
Task/Anonymous-recursion/Tcl/anonymous-recursion-4.tcl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Pick the lambda term out of the introspected caller's stack frame
|
||||
proc tcl::mathfunc::recurse args {apply [lindex [info level -1] 1] {*}$args}
|
||||
proc fib n {
|
||||
if {[incr n 0] < 0} {error "argument may not be negative"}
|
||||
apply {x {expr {
|
||||
$x < 2 ? $x : recurse([incr x -1]) + recurse([incr x -1])
|
||||
}}} $n
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue