/usr/share/tcltk/xotcl1.6.7-lib/upvarcompat.xotcl is in xotcl 1.6.7-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #$Id: upvarcompat.xotcl,v 1.3 2005/09/09 21:09:01 neumann Exp $
package provide xotcl::upvar-compat 1.0
package require XOTcl
namespace eval ::xotcl::upvar-compat {
namespace import ::xotcl::*
@ @File {description {
Provide a version of upvar and uplevel that provide
backward compatibility such that these commands
ignore inactive filter and mixin frames (upvar behaves
the same whether or not a filter is installed). Newer
scripts should use <@TT>upvar/uplevel [self callinglevel] var/command</@TT>
instead.
} }
}
# Define upvar and uplevel; use the level, if given explizitely:
# otherwise point to the callinglevel from XOTcl
rename ::uplevel ::xotcl::tcl_uplevel
proc ::uplevel {lvl args} {
set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel]
if {[string match #* $cl]} {
# we were called from XOTcl, use the XOTcl method
set cmd [concat [list my uplevel $lvl] $args]
} else {
# no XOTcl in sight, use tcl variant
set cmd [concat [list ::xotcl::tcl_uplevel $lvl] $args]
}
#puts stderr cmd=$cmd
set code [catch [list ::xotcl::tcl_uplevel 1 $cmd] msg]
return -code $code $msg
}
rename ::upvar ::xotcl::tcl_upvar
proc ::upvar {lvl args} {
set cl [::xotcl::tcl_uplevel 1 ::xotcl::self callinglevel]
if {[string match #* $cl]} {
# we were called from XOTcl, use the XOTcl method
set cmd [concat [list my upvar $lvl] $args]
#set code [catch {my uplevel $lvl $args} msg]
} else {
# no XOTcl in sight, use tcl variant
set cmd [concat [list ::xotcl::tcl_upvar $lvl] $args]
}
set code [catch [list ::xotcl::tcl_uplevel 1 $cmd] msg]
return -code $code $msg
}
puts stderr HU
|