[tclcn] Re: [tclcn] Tcl 中的 with

  • From: "Mike Manilone" <crtmike@xxxxxx>
  • To: tclcn@xxxxxxxxxxxxx
  • Date: Sat, 14 Sep 2013 23:36:27 -0400

啥意思?如果是例子的话,很好写啊

proc repeat {n body} {
    for {set i 0} {$i < $n} {incr i} {
        uplevel 1 $body
    }
}

然后调用 repeat 5 {set i 0; puts $i}  就能输出五个 0 了。

----- Original Message -----
From: 568263554@xxxxxx
Sent: 09/15/13 10:21 AM
To: tclcn
Subject: [tclcn] 回复:[tclcn] Tcl 中的 with
 求 tcl中的 uplevel

Other related posts: