_backwards_compatibility.tcl 903 B

12345678910111213141516171819202122
  1. # Provide 'quit' command for backwards compatibility. The preferred command is
  2. # now 'exit'. Tcl normally only has a 'exit' command. Also most shells have
  3. # exit but no quit.
  4. proc quit {} {
  5. # wouter: I prefer to not deprecate this, because I occasionally still
  6. # use this myself.
  7. exit
  8. }
  9. proc decr {var {num 1}} {
  10. puts stderr "This command ('decr $var $num') has been deprecated (and may be removed in a future release), please use 'incr $var -$num' instead!"
  11. uplevel incr $var [expr {-$num}]
  12. }
  13. proc restoredefault {var} {
  14. puts stderr "This command ('restoredefault $var') has been deprecated (and may be removed in a future release), please use 'unset $var' instead!"
  15. uplevel unset $var
  16. }
  17. proc alias {cmd body} {
  18. puts stderr "This command ('alias $cmd $body') has been deprecated (and may be removed in a future release), please define a proc instead: proc $cmd {} $body"
  19. proc $cmd {} $body
  20. }