Version 4 of proc or interp alias

Updated 2004-02-28 21:43:44

Which of these is better and why?

    button .b
    rename .b .b:cmd
    proc .b { args } "eval [list WidgetHandler .b] \$args"

or

    button .b
    rename .b .b:cmd
    interp alias {} .b {} WidgetHandler .b

MS prefers the second, for both clarity and performance reasons (no string parsing at run time).

PWQ An alternate for the first would be:

        proc .b {args} {uplevel 1 WidgetHandler .b $args}

So that the widget handler has access to the callers namespace et al.