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

Jeff Hobbs jeffh at activestate.com
Wed May 7 22:18:00 CEST 2008

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.



More information about the Xotcl mailing list