factorial with tailcall
Posted to
tcl
by kbk at Mon May 04 14:30:21 GMT 2009
view raw
puts
[apply {{f a} {tailcall {*}
$f
$f
1
$a
}} {apply {{f a x} {
if
{
$x
== 0} {
set
a
}
else
{
tailcall {*}
$f
$f
[
expr
{
$a
*
$x
}] [
expr
{
$x
- 1}]
}
}}} 6]
Recent Posts
tcl by emiliano
1 days ago
tcl by mookie
1 days ago
tcl by schelte
5 days ago
tcl by oldlaptop
18 days ago
tcl by mookie
24 days ago
tcl by dandyn
31 days ago
tcl by Bradipo
31 days ago
tcl by Bradipo
31 days ago
tcl by oldlaptop
55 days ago
tcl by oldlaptop
55 days ago
Submit
New paste
Documentation
From Jabber