Skip to content
Tcl Source Code History Of Ticket 472113ffff
Login

History Of Ticket 472113ffff

Artifacts Associated With Ticket 472113ffff

  1. Ticket change [1d76cb422d] (rid 90813) by hartweg on 2001-10-17 15:41:42:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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:
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "hartweg"
    9. subsystem initialized to: "None"
    10. title initialized to: "[namespace which -var] fails for ary(i)"
    11. type initialized to: "Bug"
  2. Ticket change [749c765d88] (rid 105234) by hartweg on 2001-10-17 22:58:23:

    1. icomment:
      Logged In: YES 
      user_id=338658
      
      Got submitted to quick...
      namespace eval a {
        variable ary
        set ary(i) v
        puts "1 - [namespace which -variable ary]"
        set x ary
        set y ary(i)
        puts "2 - [namespace which -variable $x]"
        puts "3 - [namespace which -variable $y]"
       }
      
      
    2. login: "hartweg"
    3. mimetype: "text/plain"
    4. username: "hartweg"
  3. Ticket change [61b4951670] (rid 92288) by hartweg on 2001-10-17 23:01:20:

    1. subsystem changed to: "21. [namespace]"
  4. Ticket change [438784ac6b] (rid 116569) by dgp on 2002-01-15 20:14:45:

    1. assignee changed to: "msofer"
  5. Ticket change [192fc9eae5] (rid 122775) by msofer on 2002-08-08 03:13:25:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      (1) Sorry, this bug somehow flew under my horizon :( 
      
      (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?
      
      (3) Depending on the answer to (2), a workaround involving
      [info exists] may be the solution for now.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  6. Ticket change [1b793a1123] (rid 123158) by dgp on 2003-11-13 08:36:13:

    1. foundin changed to: "obsolete: 8.4a3"
  7. Ticket change [4b75ce7546] (rid 126716) by msofer on 2006-10-01 22:07:23:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      This cannot be fixed at reasonable cost without changing the
      Var struct: an array element does not know it's containing
      array, even though it knows its hashtable.
      
      This will probably not happen until Tcl9. Leaving the bug
      open to fix at that time.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  8. Ticket change [31e27e657d] (rid 93513) by msofer on 2009-05-01 08:30:08:

    1. priority changed to: "6"
  9. Ticket change [15f940948a] (rid 153752) by oehhar on 2017-05-15 11:46:42:

    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"
  10. Ticket change [20681b4ae0] (rid 153753) by sebres on 2017-05-15 17:56:00:

    1. icomment:
      <blockquote>check if it is an array. If not -> error</blockquote>
      
      I guess, it should rather return "" in this case, because currently "namespace which" will never produce an error (by valid command syntax).
      It would be also similar to "no error" (just empty return) by following code:
      <pre>
      unset -nocomplain novar
      namespace which -variable novar
      </pre>
      
    2. login: "sebres"
    3. mimetype: "text/html"
  11. Ticket change [529616e502] (rid 153771) by oehhar on 2017-05-16 07:18:48:

    1. icomment:
      Sebres wrote:
      <verbatim>
      I guess, it should rather return "" in this case, because currently "namespace which" will never produce an error (by valid command syntax).
      </verbatim>
      
      You are right. Personnally, I can not understand the usage for this. I would like to have an error instead of an empty return.
      
      Thats why I did not find a bug for monthes. I wrote:
      
      <verbatim>
      ttk::radiobutton ... -variable [namespace which -variable a(b)]
      </verbatim>
      
      Clearly an error, but no error raised and it just does not work.
      
      Thanks,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"