Posted to tcl by kbk at Thu May 25 16:57:16 GMT 2017view raw

  1. # Ambiguous syntax of 'switch':
  2.  
  3. proc test {args} {
  4. puts [info level 0]
  5. }
  6. proc bad {x} {
  7. switch -exact $x this {test with this {puts "haha, gotcha!"} and $x}
  8. }
  9. bad good
  10. bad this
  11. bad -nocase
  12.  
  13. # result:
  14.  
  15. test with this {puts "haha, gotcha!"} and this
  16. haha, gotcha!
  17.  
  18.