Artifacts Associated With Ticket 214cc0eb22
Ticket change [3bb39bb64c] (rid 140549) by dgp on 2014-11-04 23:48:17:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Pointed out on comp.lang.tcl: > % set str {# 1 2 3} > # 1 2 3 > % lappend str > {#} 1 2 3 > > % set str {# 1 2 3} > # 1 2 3 > % [subst lappend] str > # 1 2 3 The lappend command ought to behave the same whether bytecode compiled or not. The bytecode compiled behavior is what's new and creating the inconsistency. - is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "47. Bytecode Compiler"
- title initialized to: "lappend no-op function changes when compiled"
- type initialized to: "Bug"
Ticket change [530f82d6a2] (rid 140550) by dgp on 2014-11-05 05:39:05:
- assignee changed to: "dkf"
- foundin changed to: "8.6.2"
- icomment:
Introduced in http://core.tcl.tk/tcl/info/17150b71d2
- login: "dgp"
- mimetype: "text/plain"
Ticket change [303c766bb1] (rid 140551) by dgp on 2014-11-05 06:38:01:
- icomment:
Simplest possible fix committed to trunk: disable compile of the inconsistent case. Leaving open in case dkf wants to pursue actually patching up the behavior of all the new bytecode instructions instead. There's a natural question to be asked here about whether [lappend] ought to be always producing canonical lists. It has not been doing so up to now. The argument in favor is to expand the set of commands one can use to create commands for evaluation with complete confidence. set script "a\nb" eval [lappend script {*}$args] ;# one command or two?! The argument against is that a no-op is best implemented as a no-op (but in that case, why are we checking for list-ness?). In particular, here a variable is involved and given the chance to leave a variable's contents untouched, we should (and avoid triggering traces, etc.). I don't think either case is completely convincing to me, leaving me uncertain which is more properly the best behavior to choose. In that situation I break the tie by keeping consistency with the historical practice. Other opinions are invited. In particular examples of existing use of [lappend] to produce scripts for evaluation would be good to know about, in particular, those combined with {*} that might degenerate to the troublesome case. - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [438cbe91f8] (rid 140598) by dkf on 2014-11-07 15:56:20:
- icomment:
No, that's the right fix. The form <tt>lappend somevar</tt> is very strange in that it creates the variable if necessary, checks that value it contains is a well-formed list, yet doesn't otherwise modify the variable. Given how much of an evil edge case this is, I'm just going to leave it to the interpreted version; fixing things will require doing changes to the semantics of <tt>lappend</tt> (i.e., not Tcl 8.6). <p> Expansion isn't a problem: it currently always delegates to the interpreted code.
- login: "dkf"
- mimetype: "text/html"
- username: "dkf"
- icomment:
Ticket change [e53bf9aa1c] (rid 140608) by dkf on 2014-11-08 07:07:00:
- closedate changed to: "2456969.79653413"
- closer changed to: "dkf"
- icomment:
I've added some tests so that we won't slip up like this again, including with expansion. It will make dealing with expansion much harder, but that's for the future.
- login: "dkf"
- mimetype: "text/html"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"
Ticket change [a98ecec75b] (rid 235085) by jan.nijtmans on 2024-11-14 10:34:47:
- closedate changed to: "2460628.94082536"
- closer changed to: "jan.nijtmans"
- icomment:
Given [e38dce74e28420b6|this] ticket, do we need to revisit this? Or do we consider the change for 9.0 but not for 8.x?
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"