Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 136f2a17692ce31a7c49ad9adad26f4aac2a8099
Ticket: 1905809fffffffffffffffffffffffffffffffff
lreplace man page description for negative index confusing
User & Date: v_f on 2008-03-02 19:10:32
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    lreplace man page states:
    
    "If last is less than zero but greater than first, then any specified elements will be prepended  to  the  list."
    
    What happens if last is less than zero and equal to first? My use case is to search the list for an element and then delete it if it exists. Otherwise the list should be unmodified:
    
    % set L {a b c}
    a b c
    % set i [lsearch $L x]
    -1
    % lreplace $L $i $i
    a b c
    
    This obviously works, but is it guaranteed?
    
    
  4. foundin changed to: "obsolete: 8.5.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "v_f"
  10. subsystem changed to: "17. Commands I-L"
  11. title changed to:
    lreplace man page description for negative index confusing
    
  12. type changed to: "Bug"