Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3200 info globals works wrong inside proc

obsolete: 8.4.9
closed-fixed
7
2005-07-29
2005-07-28
Anonymous
No

Name: Lawrence D'Oliveiro
Contact e-mail: from-sourceforge@geek-central.gen.nz

Systems tried: SuSE Linux 9.3 x86-64, tcl 8.4.9-7 vs SuSE 9.1
x86 (32-bit), tcl 8.4.6-26

On the system running 8.4.9, "info globals" is returning a
nonempty result for an undefined global, when it should be
returning an empty result. Furthermore, it only does this inside a
proc.

For example, try this command sequence from the tclsh command
prompt:

proc Try {} {global Glob; info globals Glob}
Try

Assuming that there is no global variable named "Glob", this
returns an empty result on 8.4.6, but it returns "Glob" on 8.4.9.

If you try the same commands as the procedure body, entered
directly:

global Glob
info globals Glob

This sequence returns an empty result on both 8.4.6 and 8.4.9.

Discussion

  • Don Porter
    Don Porter
    2005-07-28

    Logged In: YES
    user_id=80530

    This was a change in behavior
    between releases 8.4.7 and 8.4.8.

    The "changes" file says it's a fix for
    Bug 1057461. Or possibly a
    consequence of the
    TclMatchIsTrivial() changes?

     
  • Don Porter
    Don Porter
    2005-07-28

    • priority: 5 --> 7
     
  • Don Porter
    Don Porter
    2005-07-28

    Logged In: YES
    user_id=80530

    Yes, it looks like the
    TclIsVarUndefined() check
    didn't get copied over to
    the optimized version that
    directly looks up trivial
    patterns.

     
  • Logged In: YES
    user_id=79902

    Fixed in HEAD and 8.4 branch

     
    • status: open --> closed-fixed