Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 15f940948a9d1c0041ae0e801739619c24945965
Ticket: 472113ffffffffffffffffffffffffffffffffff
[namespace which -var] fails for ary(i)
User & Date: oehhar on 2017-05-15 11:46:42
Changes

  1. closer changed to: "nobody"
  2. comment changed to:
    [namespace which -variable ary(i)] returns a null 
    string even when ary(i) exists! This is a major pain
    when trying to get fully scoped variable names to give 
    to widgets. Here is a script snippet that shows the 
    eror:
    
  3. icomment:
    Miquel Sofer wrote:
    <verbatim>
    (2) It's not so clear to me what the correct fix would be:
    what should happen if the array itself exists, but the array
    element does not? In your script, what is the expected
    result of adding a line
       puts "4 - [namespace which -variable ary(k)]"
    According to the man page, the return should be "" - is this
    what you're expecting?
    </verbatim>
    
    Let me express my expectation.
    <b>[namespace which -variable ary(k)]</b> should do the following:
       *   resolve "ary" in the local scope
       *   check if it is an array. If not -> error
       *   format the result the same way as <b>[namespace which -variable ary](k)</b>. This means, that the existence of the given array index must not exist and is not relevant. The existance of the array and its scope is important.
    
  4. login: "oehhar"
  5. mimetype: "text/x-fossil-wiki"
  6. severity changed to: "Minor"
  7. username: "oehhar"