Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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