Dear XOTcl-guys! The script below might illustrate another XOTcl bug. tested with: Tcl8.4.16 + XOTcl1.5.6 Tcl8.5.0 + XOTcl1.5.6
regards Florian
# ************************************************************************ ****** puts "Tcl[set ::tcl_patchLevel]" ;# Tcl8.4.16 puts "XOTcl [package require XOTcl]" ;# XOTcl 1.5.5 1.5.6 namespace import xotcl::* package require Tk # ######################################################################## ###### Class X -slots { Attribute create q } # ************************************************************************ ****** #fm The printout here is not what I would expect! #fm expected: ::b fun .w #fm but got: ::b next .w X instproc fun {w} { puts "[self] [info level 0]"; button $w.b; return $w.b } # ************************************************************************ ****** # ######################################################################## ###### Class ::X::Y -superclass ::X # ************************************************************************ ****** ::X::Y instproc fun {w} { pack [next $w] } # ######################################################################## ###### ::X::Y create ::b toplevel .w ::b fun .w
Murr, Florian schrieb:
Dear XOTcl-guys! The script below might illustrate another XOTcl bug.
Dear Florian,
That's not a bug. [info level 0] does not return the name of the method in all situations, since "info level" is not xotcl-aware and is not touched by the xotcl implementation. In situations, where - from the Tcl point of view - the cmd "next" calls a method, "info level 0" returns "next". There is nothing wrong about this.
X instproc fun {w} { puts "[self] [info level 0]"; button $w.b; return $w.b }
In cases, where you want to output the name of the active method, use XOTcl's callstack introspection with - in this case - "self proc". Change your code as follows to obtain the method name in the outpt.
X instproc fun {w} {puts "[self] [self proc]"; button $w.b; return $w.b }
best regards -gustaf neumann