Skip to content
Tcl Source Code History Of Ticket a122627849
Login

History Of Ticket a122627849

Artifacts Associated With Ticket a122627849

  1. Ticket change [b3f958f339] (rid 135727) by anonymous on 2013-11-22 13:45:46:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/html"
    4. comment initialized to:
      There's a bug in the built-in 'parray' procedure of Tcl 8.4.
      <br />
      The 'parray' procedure check if the variable is an array, and if it is not, then it tries to print it's content instead of it's name.
      
       
      
      Code example:
      <pre>
      proc array_to_list {arr_VarName} {
                      upvar $arr_VarName arr
                      if [array exists arr] {
                                      set tmp [array get arr]
                                      parray arr
                                      unset arr
                                      parray arr
                                      array set arr [array get tmp]
                                      return 1
                      }
                      return 0
      }
      
      set b(a) "5"
      set b(c) "asdas"
      set b(dd) "al94i"
      
      if [array_to_list b] {
                      puts $b
      } else {
                      puts "BAAAAAAA"
      }
      </pre>
      
      Output example:
      <pre>
      arr(a)  = 5
      arr(c)  = asdas
      arr(dd) = al94i
      
      "arr" isn't an array
          while executing
      "error "\"$a\" isn't an array""
          (procedure "parray" line 4)
          invoked from within
      "parray arr"
          invoked from within
      "if [array exists arr] {
                                      set tmp [array get arr]
                                      parray arr
                                      unset arr
                                      parray arr
                                      array set arr [array get tmp]
                                      return 1
                      }"
          (procedure "array_to_list" line 3)
          invoked from within
      "array_to_list b"
          invoked from within
      "if [array_to_list b] {
                      puts $b
      } else {
                      puts "BAAAAAAA"
      }"
          (file ".\test.tcl" line 22)
      </pre>
      
      The line "error "\"$a\" isn't an array"" has the error, which is relevant to the second 'parray arr' line that is in the 'array_to_list' procedure.
      <br />
      ActiveState ActiveTcl <br />8.4.20.0.297203                                              Jun 05, 2013
      
    5. foundin initialized to: "8.4"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "5d6a65d81064024e292e94471bcec5cccc966f90"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "- New Builtin Commands"
    15. title initialized to: "procedure 'parray' doesn't check for an array"
    16. type initialized to: "Bug"
  2. Ticket change [b4ec33673c] (rid 135728) by dkf on 2013-11-22 13:58:15:

    1. assignee changed to: "dkf"
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "3 Low"
    5. subsystem changed to: "38. Init - Library - Autoload"
  3. Ticket change [02bcfc780b] (rid 135729) by jan.nijtmans on 2013-11-22 16:05:44:

    1. icomment:
      This error message:
      
      "arr" isn't an array
      
      looks perfectly OK to me.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
    4. resolution changed to: "Invalid"
    5. status changed to: "Pending"
  4. Ticket change [a91adf9e6b] (rid 135735) by dkf on 2013-11-24 17:20:01:

    1. icomment:
      I suppose we could use <tt>return -code error</tt> instead of <tt>error</tt>. Like it's important.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  5. Ticket change [377a37bd72] (rid 135736) by dkf on 2013-11-24 17:37:09:

    1. icomment:
      Actually, it makes sense to make that change; it's not an error in <tt>parray</tt> itself, so much as its caller. It also doesn't break any existing tests in 8.5 (8.4 being closed to changes now…)
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  6. Ticket change [454805c0cc] (rid 135739) by dkf on 2013-11-24 18:37:38:

    1. closedate changed to: "2456621.2761416"
    2. closer changed to: "dkf"
    3. icomment:
      “Fixed” the error trace message in 8.5 and 8.6. No sense in confusing people unnecessarily.
      
    4. login: "dkf"
    5. mimetype: "text/html"
    6. status changed to: "Closed"
    7. username: "dkf"
  7. Ticket change [ce7effe25b] (rid 135740) by jan.nijtmans on 2013-11-24 20:50:22:

    1. closedate changed to: "2456621.36831343"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Yes that makes sense! Indeed, less confusing. Thanks!
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"