View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] xotcl::upvar-compat isn't compatible

From: Jeff Hobbs <jeffh_at_activestate.com>
Date: Wed, 07 May 2008 13:18:00 -0700

Someone asked on chat why the unknown stuff (e.g., typing an unknown
command name into the console) in tkcon "broke" after doing:

package require xotcl::upvar-compat

I looked at the code there, and the uplevel redef isn't actually
compatible because it ignores error codes. Instead of:

        ::xotcl::tcl_uplevel 1 \
                [list eval ::xotcl::tcl_uplevel $lvl $args]

you need something like:

        set code [catch {::xotcl::tcl_uplevel 1 \
                [list eval ::xotcl::tcl_uplevel $lvl $args]} msg]
        return -code $code $msg

Just an FYI for anyone using it. I'm not sure what effect this would
have, if any, on the xotcl use case.

Regards,

Jeff