Skip to content
Tcl Source Code History Of Ticket 44fd4b9a4e
Login

History Of Ticket 44fd4b9a4e

Artifacts Associated With Ticket 44fd4b9a4e

  1. Ticket change [18fa2d222d] (rid 142111) by sbron on 2015-06-21 19:35:01:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      % lreplace a 1 end 
      a
      % set x 1; lreplace a $x end
      list doesn't contain element 1
      
    5. foundin initialized to: "8.6.4"
    6. is_private initialized to: "0"
    7. login: "sbron"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "8475f421649231f1e116ac602bea4537d2b027b4"
    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: "More lreplace weirdness"
    16. type initialized to: "Bug"
  2. Ticket change [0691857030] (rid 142112) by ferrieux on 2015-06-21 21:01:02:

    1. icomment:
      Seems to be a day-one bug of the compiled version of lreplace in [e3106247db]
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  3. Ticket change [6db31a5489] (rid 142114) by ferrieux on 2015-06-21 21:21:48:

    1. icomment:
      Also, looking at the complexity of the code, I'm wondering whether it's wise to invest so much to optimize such corner cases. I don't find it too demanding to ask a sensible person to use [lrange] instead of [lreplace .. end].
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  4. Ticket change [553f84ef86] (rid 142159) by aspect on 2015-06-22 03:28:54:

    1. icomment:
      Looks like this one is triggering in the *non-compiled* version of lreplace.  Ferrieux, am I not seeing an important connection to [e3106247db]?
      
      <a href="http://core.tcl.tk/tcl/artifact/066b3a6791fefd66?ln=2748-2761">this</a> seems to be the test that is breaking down.  I need more caffeine and crayons before attacking it confident I'm not going to make things worse.
      
      According to kbk on the chat, <tt>lreplace a 1 end</tt> should Do Nothing Gracefully.  <tt>lreplace a 2 end</tt> should error as it's asking to leave a nonexistent element.
      
      There seem to be more problems ([47ac84309b]) with compiled lreplace clouding the issue.  Ugh.
      
    2. login: "aspect"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [c81803fcdc] (rid 142160) by aspect on 2015-06-22 04:56:05:

    1. icomment:
      <p><a href="http://core.tcl.tk/tcl/artifact/38344c8a167d9207?ln=33-35">lreplace.n</a> does not support the theory that 1-past-the-end is a valid index for lreplace:
      
      <p><i>"For non-empty lists, the element indicated by first must exist or first must indicate before the start of the list."</i>
      
      <p>The interpreted implementation (referenced in this ticket) agrees with the manual.  The compiled version (<a href="http://core.tcl.tk/tcl/info/47ac84309b">inconsistently</a>) currently does not - presumably so that <tt>end+1</tt> can be used to append.
      
      <p>Before proceeding to fix both these tickets, I think we should agree on whether <tt>end+1</tt> indexes should be allowed for <tt>lreplace</tt>, and if so, start by crafting a clear description for the manual.
      
    2. login: "aspect"
    3. mimetype: "text/html"
  6. Ticket change [b06258ac58] (rid 142161) by aspect on 2015-06-22 06:32:53:

    1. icomment:
      Further unusual behaviour I don't understand (error suppression for the empty list) is described at  [http://paste.tclers.tk/3547].  Anyone know why that behaviour exists?  Do we want it?
      
    2. login: "aspect"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [6a31430610] (rid 142166) by ferrieux on 2015-06-22 17:03:22:

    1. icomment:
      My earlier remark on the compiled version being "buggy" is, of course, relative to the documented behavior ("first must exist").
      
      Now since you're suggesting to make slightly incompatible, but extremely reasonable updates to the documented semantics: yes, I agree that one single rule should define allowed positions in [lreplace]: make sure that the target range "touches" the input list.
      
      This allows for
      
        lreplace a 1 end
        lreplace {} 0 end
      
      and precludes
      
        lreplace a 2 end
        lreplace {} 1 end
      
      So I'm okay if your plan is to update the noncompiled semantics as just described.
      
      As to the compiled version, again, I'd suggest to drastically reduce the ambition of the optimizer (especially the handling of the lrange-equivalent cases known at compile time, since there's no demand).
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  8. Ticket change [ff0043cdac] (rid 142942) by dkf on 2015-08-30 20:25:52:

    1. assignee changed to: "dkf"
    2. login: "dkf"
    3. mimetype: "text/plain"
  9. Ticket change [6e3a0e9f96] (rid 146327) by anonymous on 2016-04-17 01:14:29:

    1. closedate changed to: "2457495.55172726"
    2. closer changed to: "anonymous"
    3. icomment:
      This was fixed with [47ac84309b] in [d561a9353].  The resolution makes behaviour uniform on empty lists, resolving everything raised in this ticket.
      
    4. login: "anonymous"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "aspect"