Posted to tcl by dkf at Sun Jul 20 22:12:14 GMT 2008view pretty

proc generate-stuff {v count script} {
    upvar 1 $v vv
    for {set vv 0} {$vv<$count} {incr vv} {
        set location [uplevel 1 $script]
        doSomethingWithThe $location
    }
}
set radius 42.37
generate-stuff theta 100 {
    list [expr {sin($theta/100.) * $radius}] [expr {cos($theta/100.) * $radius}]
}