Skip to content
Tcl Source Code History Of Ticket ccc2c2cc98
Login

History Of Ticket ccc2c2cc98

Artifacts Associated With Ticket ccc2c2cc98

  1. Ticket change [fef62f00d4] (rid 139636) by sbron on 2014-09-04 08:31:53:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      In Tcl 8.6.2 the command [lreplace {} 1 1] produces an error: "list doesn't contain element 1". This conflicts with the manual page, which specifically mentions: "If list is empty, then first and last are ignored". In Tcl 8.6.1 the indicated command returns an empty list, as expected.
      
    5. foundin initialized to: "8.6.2"
    6. is_private initialized to: "0"
    7. login: "sbron"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "e6e0da3db38bd7f7aaef501760314ad0221f3e23"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "sbron"
    14. subsystem initialized to: "17. Commands I-L"
    15. title initialized to:
      lreplace on an empty list produces an error where it didn't use to.
      
    16. type initialized to: "Bug"
  2. Ticket change [388d778a0d] (rid 139637) by dkf on 2014-09-04 09:49:14:

    1. assignee changed to: "dkf"
    2. icomment:
      Bother it! (This wasn't a test case, but perhaps should have been.)
      
    3. login: "dkf"
    4. mimetype: "text/html"
    5. priority changed to: "8"
    6. username: "dkf"
  3. Ticket change [eb2cce2523] (rid 139638) by dgp on 2014-09-04 15:43:34:

    1. icomment:
      Oh my stars, what a mess!
      
      See
      
      http://core.tcl.tk/tcl/tktview?name=218675
      
      for the mortifying history.
      
      Yeah, lets fix bugs by documenting them!  That's the ticket!
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [df29793982] (rid 139639) by dgp on 2014-09-04 16:10:21:

    1. icomment:
      Given the freedom to reboot, it's clear to me that
      the behavior that would be both consistent and
      useful would be for
      
          lreplace $list $first $last $new1 ... $newN
      
      to find the same range of existing elements specified
      by
      
          lrange $list $first $last
      
      remove them and in their place insert $new1 through $newN
      
      In the case where the element range to remove is empty,
      insert the new elements at the position identified by $first
      
      No errors for any syntactically valid indices.
      
      Would be a big change around the edges though.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [bcd28eab06] (rid 139646) by dkf on 2014-09-05 09:01:47:

    1. icomment:
      Yuck. [218675] is just weird, as is the whole detail of how lreplace works in detail. The behaviour in 8.5 (which uses the interpreted code) is not to return the original object when it is an empty list, but rather to use the empty string (noticeable when you use an input containing nothing but spaces).
      
    2. login: "dkf"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "dkf"
  6. Ticket change [3229e307bf] (rid 139650) by dgp on 2014-09-05 10:40:02:

    1. icomment:
      That detail doesn't bother me.  It can be understood
      as part of a contract that [lreplace] is to return only
      lists with canonical string reps.  As we just went
      through with [dict replace].
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  7. Ticket change [e7fc6bc633] (rid 139651) by dkf on 2014-09-05 12:18:00:

    1. closedate changed to: "2456906.0125096"
    2. closer changed to: "dkf"
    3. icomment:
      Leaving aside the question of what the behaviour ought to be, I've added the extra check to the bytecode issued.
      
    4. login: "dkf"
    5. mimetype: "text/html"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"