Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2e5d2942de944130a0eeed2db8a6143fed3d87e8
Ticket: 219387ffffffffffffffffffffffffffffffffff
info locals seems not to work properly
User & Date: nobody on 2000-10-26 05:12:08
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 6131 Bug
    Version: 8.3.2
    SubmitDate: '2000-08-14'
    LastModified: '2000-10-25'
    Severity: MED
    Status: UnAssn
    Submitter: techsupp
    OS: Linux-SuSE
    OSVersion: SuSE 6.4
    Machine: AMD K6
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Christian Eva
    
    ReproducibleScript:
    proc xloc {args} {
        global Defaults LikeDictionaries env L1
        global Dictionaries
    
        foreach m $args {
            set $m $m
        }
    
        puts "locals=[info locals]"
    
        set L1 [info locals]
        puts "L1=$L1"
    
        unset args
    
        foreach a [info locals {[a-zA-Z]?*}] {
            puts "a=$a"
            eval set v \$$a
            set Dictionaries($a) $v
        }
    }
    
    set L1 empty
    
    xloc a aA b Ba ccc 
    
    puts "L1=$L1"
    
    parray Dictionaries
    # end
    
    bash-2.03$ tclsh8.0 localtest
    locals=args m L1 a ccc b aA Ba
    L1=args m L1 a ccc b aA Ba
    a=L1
    a=ccc
    a=aA
    a=Ba
    L1=args m L1 a ccc b aA Ba
    Dictionaries(Ba)  = Ba
    Dictionaries(L1)  = args m L1 a ccc b aA Ba
    Dictionaries(aA)  = aA
    Dictionaries(ccc) = ccc
    bash-2.03$ 
    
    bash-2.03$ tclsh8.3 localtest
    locals=args m L1 a Dictionaries ccc b aA Ba
    L1=args m L1 a Dictionaries ccc b aA Ba
    a=L1
    a=Dictionaries
    can't read "Dictionaries": variable is array
        while executing
    "set v $Dictionaries"
        ("eval" body line 1)
        invoked from within
    "eval set v \$$a"
        (procedure "xloc" line 18)
        invoked from within
    "xloc a aA b Ba ccc "
        (file "localtest" line 25)
    bash-2.03$
    
    ObservedBehavior:
    First I do not understand why "info locals" does list the global variables. It seems to lists them as soon as they are referenced in the procedure. 
    
    Second: The example works in tcl8.0 but not in 8.3. If I put the line
        global Dictionaries
    
    down into the foreach loop it works as a workaround:
        foreach a [info locals {[a-zA-Z]?*}] {
            global Dictionaries
            puts "a=$a"
            eval set v \$$a
            set Dictionaries($a) $v
        }
    
    This is an extract out of a running program since 7.6. In 8.0 the error does not cause trouble but under 8.3 it crashes.
    
    DesiredBehavior:
    I would expect the varables listed in the global statement not to be
    listed by "info locals" at all.
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "info locals seems not to work properly"
  11. type changed to: "Bug"