Skip to content
Tcl Source Code History Of Ticket 214cc0eb22
Login

History Of Ticket 214cc0eb22

Artifacts Associated With Ticket 214cc0eb22

  1. Ticket change [3bb39bb64c] (rid 140549) by dgp on 2014-11-04 23:48:17:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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.
      
    5. is_private initialized to: "0"
    6. login: "dgp"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Minor"
    10. status initialized to: "Open"
    11. submitter initialized to: "dgp"
    12. subsystem initialized to: "47. Bytecode Compiler"
    13. title initialized to: "lappend no-op function changes when compiled"
    14. type initialized to: "Bug"
  2. Ticket change [530f82d6a2] (rid 140550) by dgp on 2014-11-05 05:39:05:

    1. assignee changed to: "dkf"
    2. foundin changed to: "8.6.2"
    3. icomment:
      
      Introduced in http://core.tcl.tk/tcl/info/17150b71d2
      
    4. login: "dgp"
    5. mimetype: "text/plain"
  3. Ticket change [303c766bb1] (rid 140551) by dgp on 2014-11-05 06:38:01:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [438cbe91f8] (rid 140598) by dkf on 2014-11-07 15:56:20:

    1. 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.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  5. Ticket change [e53bf9aa1c] (rid 140608) by dkf on 2014-11-08 07:07:00:

    1. closedate changed to: "2456969.79653413"
    2. closer changed to: "dkf"
    3. 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.
      
    4. login: "dkf"
    5. mimetype: "text/html"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dkf"
  6. Ticket change [a98ecec75b] (rid 235085) by jan.nijtmans on 2024-11-14 10:34:47:

    1. closedate changed to: "2460628.94082536"
    2. closer changed to: "jan.nijtmans"
    3. 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?
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"