Posted to tcl by kbk at Mon May 04 14:30:21 GMT 2009view pretty
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]
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]