summaryrefslogtreecommitdiffstats
path: root/tests/langbench/proc.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-19 20:35:49 (GMT)
commit66032e8a327e0498b0d8970307452f66c69be25c (patch)
tree345b92b9d0c1be0f8ff45032a38884929744545e /tests/langbench/proc.tcl
parent0a228666ae8b3189ae92ff7624263de1455c24ff (diff)
downloadtcl-66032e8a327e0498b0d8970307452f66c69be25c.zip
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.gz
tcl-66032e8a327e0498b0d8970307452f66c69be25c.tar.bz2
Fork of Tcl used in the "Little" project.
http://www.mcvoy.com/lm/little/index.html
Diffstat (limited to 'tests/langbench/proc.tcl')
-rw-r--r--tests/langbench/proc.tcl16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/langbench/proc.tcl b/tests/langbench/proc.tcl
new file mode 100644
index 0000000..034190a
--- /dev/null
+++ b/tests/langbench/proc.tcl
@@ -0,0 +1,16 @@
+proc a {val} { return [b $val] }
+proc b {val} { return [c $val] }
+proc c {val} { return [d $val] }
+proc d {val} { return [e $val] }
+proc e {val} { return [f $val] }
+proc f {val} { return [g $val 2] }
+proc g {v1 v2} { return [h $v1 $v2 3] }
+proc h {v1 v2 v3} { return [i $v1 $v2 $v3 4] }
+proc i {v1 v2 v3 v4} { return [j $v1 $v2 $v3 $v4 5] }
+proc j {v1 v2 v3 v4 v5} { return [expr $v1 + $v2 + $v3 + $v4 + $v5] }
+proc main {} {
+ set n 100000
+ while {$n > 0} { set x [a $n]; incr n -1 }
+ puts $x
+}
+main