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

    itcl::class test_args {
        method none {} {
            return "none"
        }
        method two {x y} {
            return "two: $x $y"
        }
        method defvals {x {y def1} {z def2}} {
            return "defvals: $x $y $z"
        }
        method varargs {x {y def1} args} {
            return "varargs: $x $y ($args)"
        }
        method nomagic {args x} {
            return "nomagic: $args $x"
        }
        method clash {x bang boom} {
            return "clash: $x $bang $boom"
             method clash_time {x bang boom} {
            time {set result "clash_time: $x $bang $boom"} 1
            return $result
        }
        proc crash {x bang boom} {
            return "crash: $x $bang $boom"
        }
        proc crash_time {x bang boom} {
            time {set result "crash_time: $x $bang $boom"} 1
            return $result
        }
        variable bang "ok"
        common boom "no-problem"
    }
   }