For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2005 > [info vars ?pattern?] problem during unset trace









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [info vars ?pattern?] problem during unset trace
neuronstorm@gmail.com

2005-10-25, 9:57 pm

The following script demonstrates an invalid result (empty string
element in list) from [info vars ?pattern?] during unset traces called
during [namespace delete].

----

namespace eval ::ref {}

set ::ref::var1 AAA
trace add variable ::ref::var1 {unset} [list doTrace]

set ::ref::var2 BBB
trace add variable ::ref::var2 {unset} [list doTrace]

proc doTrace {vtraced vidx op} {
puts stdout "'[info vars ::ref::*]'"
}

namespace delete ::ref

puts stdout "'[info vars ::ref::*]'"

----

Output on windows Tcl 8.5a4 is:

'::ref::var1 ::ref::var2'
'{} ::ref::var2'
''

Output on windows Tcl 8.4.5 is:
'::ref::var1 ::ref::var2'
'::ref::var2'
''



JMN

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com