Macports Tcl

Gustaf Neumann neumann at wu.ac.at
Tue Jul 9 10:21:41 PDT 2013


Am 09.07.13 17:56, schrieb Clemens Lang:
> Unfortunately the try implemented in tcl 8.6 seems to be TIP #329 [1].
oops, you are right, forgot that (the discussion was in 2008).
> At a glace, it seems MacPorts' try indeed conforms to TIP #89, but TIP
> #329 no longer provides the "catch" block available in #89, which is
> used widely throughout the MacPorts codebase.
I have the feeling, the most (all?) of the usages of "try" in the 
MacPorts base
are of the form

     try {
        incr i 1.0
     } catch * {
        set i 1
     } finally {
        puts done
     }

actually, most times without the "finally".

The "catch *" is roughly equivalent to "on error",
tcl 8.6 allows also "on break" etc. for other
return codes and as well prefix matching
against a.g. POSIX messages (http://wiki.tcl.tk/8293)

The rough equivalent for "catch *" in tcl 8.6 is

     try {
        incr i 1.0
     } on error {errorMessage} {
        puts "trapped: $errorMessage"
        set i 1
     } finally {
        puts done
     }

It certainly needs an update in the macports
base, but i would not expect this to be painful.
Let me know, if i can help.

Keeping macports's private tip89 solution is on
the long run probably not worth the potential confusion.

-gustaf



More information about the macports-dev mailing list