Skip to content
Tcl Source Code History Of Ticket b55589c55b36c990
Login

History Of Ticket b55589c55b36c990

Artifacts Associated With Ticket b55589c55b36c990

  1. Ticket change [4712a9be30] (rid 208839) by rbucker on 2023-02-17 14:41:26:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-markdown"
    4. comment initialized to:
      The doc says...
      
      The integer appearing in each index argument must be greater than or equal to zero. The integer appearing in each index argument must be strictly less than the length of the corresponding list. In other words, the lset command cannot change the size of a list. If an index is outside the permitted range, an error is reported.
      
      my test case:
      
      ```
      set abc [list a b c];
      puts "${abc}";
      puts "[lset abc 2 x]";
      
      
      # error cases
      puts "[catch {lset abc -2 x} res] res:$res";
      puts "[llength ${abc}]";
      puts "[catch {lset abc 14 x} res] res:$res";
      puts "[catch {lset abc 13 x} res] res:$res";
      puts "[catch {lset abc 12 x} res] res:$res";
      
      puts "[catch {lset abc 3 x} res] res:$res";
      puts "[llength ${abc}]";
      puts "[catch {lset abc 4 x} res] res:$res";
      puts "[llength ${abc}]";
      ```
      
      returns
      
      ```
      a b c
      a b x
      1 res:list index out of range
      3
      1 res:list index out of range
      1 res:list index out of range
      1 res:list index out of range
      0 res:a b x x
      4
      0 res:a b x x x
      5
      ```
      
      Notice that when the index is exactly the length of the list that the newvalue is appended to the list, however, the doc says "STRICTLY" cannot change the size of the list.
      
    5. foundin initialized to: "8.6"
    6. is_private initialized to: "0"
    7. login: "rbucker"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "f1cbdd73b57f5bd1c724efe36f7caf833f36d58f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "rbucker"
    14. subsystem initialized to: "14. List Object"
    15. title initialized to: "the lset command cannot change the size of a list"
    16. type initialized to: "Bug"
  2. Ticket change [e9b0c9de13] (rid 208840) by jan.nijtmans on 2023-02-17 16:14:21:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2459993.17663973"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Current documentation says something different:
      
      [https://core.tcl-lang.org/tcl/file?udc=1&ln=82-88&ci=04cf08d26a77fbc3&name=doc%2Flset.n]
      
      So, please report this to the place where you got your documentation from.
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Out of Date"
    8. status changed to: "Closed"