Artifacts Associated With Ticket ccc2c2cc98
Ticket change [fef62f00d4] (rid 139636) by sbron on 2014-09-04 08:31:53:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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. - foundin initialized to: "8.6.2"
- is_private initialized to: "0"
- login: "sbron"
- priority initialized to: "5 Medium"
- private_contact initialized to: "e6e0da3db38bd7f7aaef501760314ad0221f3e23"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "sbron"
- subsystem initialized to: "17. Commands I-L"
- title initialized to:
lreplace on an empty list produces an error where it didn't use to.
- type initialized to: "Bug"
Ticket change [388d778a0d] (rid 139637) by dkf on 2014-09-04 09:49:14:
- assignee changed to: "dkf"
- icomment:
Bother it! (This wasn't a test case, but perhaps should have been.)
- login: "dkf"
- mimetype: "text/html"
- priority changed to: "8"
- username: "dkf"
Ticket change [eb2cce2523] (rid 139638) by dgp on 2014-09-04 15:43:34:
- 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!
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [df29793982] (rid 139639) by dgp on 2014-09-04 16:10:21:
- 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. - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [bcd28eab06] (rid 139646) by dkf on 2014-09-05 09:01:47:
- 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).
- login: "dkf"
- mimetype: "text/x-fossil-wiki"
- username: "dkf"
- icomment:
Ticket change [3229e307bf] (rid 139650) by dgp on 2014-09-05 10:40:02:
- 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].
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [e7fc6bc633] (rid 139651) by dkf on 2014-09-05 12:18:00:
- closedate changed to: "2456906.0125096"
- closer changed to: "dkf"
- icomment:
Leaving aside the question of what the behaviour ought to be, I've added the extra check to the bytecode issued.
- login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"