Posted to tcl by hypnotoad at Wed Sep 26 21:31:49 GMT 2018view raw

  1. basra:~ seandeelywoods$ cat test.tcl
  2. proc Foreach {body args} { tailcall foreach list $args $body }
  3.  
  4. set result {}
  5. Foreach {puts [list is [llength $result] long] ; lappend result {*}$list} \
  6. {a b c} \
  7. {d e f}
  8. puts FINAL
  9. puts [list is [llength $result] long]
  10.  
  11. basra:~ seandeelywoods$ tclsh test.tcl
  12. is 0 long
  13. is 3 long
  14. FINAL
  15. is 6 long
  16. basra:~ seandeelywoods$
  17.