Posted to tcl by apw at Sat Jul 21 14:53:47 GMT 2007view raw

  1. itcl::class test_args {
  2. method none {} {
  3. return "none"
  4. }
  5. method two {x y} {
  6. return "two: $x $y"
  7. }
  8. method defvals {x {y def1} {z def2}} {
  9. return "defvals: $x $y $z"
  10. }
  11. method varargs {x {y def1} args} {
  12. return "varargs: $x $y ($args)"
  13. }
  14. method nomagic {args x} {
  15. return "nomagic: $args $x"
  16. }
  17. method clash {x bang boom} {
  18. return "clash: $x $bang $boom"
  19. method clash_time {x bang boom} {
  20. time {set result "clash_time: $x $bang $boom"} 1
  21. return $result
  22. }
  23. proc crash {x bang boom} {
  24. return "crash: $x $bang $boom"
  25. }
  26. proc crash_time {x bang boom} {
  27. time {set result "crash_time: $x $bang $boom"} 1
  28. return $result
  29. }
  30. variable bang "ok"
  31. common boom "no-problem"
  32. }
  33. }
  34.