Posted to tcl by aspect at Wed Feb 12 05:26:16 GMT 2020view raw

  1. proc ok {result} {
  2. tailcall return -code ok $result
  3. }
  4.  
  5. proc notok {result} {
  6. tailcall return -code error $result
  7. }
  8.  
  9.  
  10. proc q {} {
  11. notok "I can't do that Dave"
  12. }
  13.  
  14. proc z {} {
  15. ok "I like that, please do it again"
  16. }
  17.  
  18. proc a {} {
  19. if {[catch {q} res]} {
  20. notok $res
  21. }
  22. puts "doing other stuff"
  23. ok "done"
  24. }
  25.  
  26. a