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

  1. proc generate-stuff {v count script} {
  2. upvar 1 $v vv
  3. for {set vv 0} {$vv<$count} {incr vv} {
  4. set location [uplevel 1 $script]
  5. doSomethingWithThe $location
  6. }
  7. }
  8. set radius 42.37
  9. generate-stuff theta 100 {
  10. list [expr {sin($theta/100.) * $radius}] [expr {cos($theta/100.) * $radius}]
  11. }
  12.