Ticket Change Details
Not logged in
Overview

Artifact ID: df29793982e8cc09ea45fc9bbfe5f80e6a71c82a
Ticket: ccc2c2cc983bf903292d23d1942e7255957de5bd
lreplace on an empty list produces an error where it didn't use to.
User & Date: dgp 2014-09-04 16:10:21
Changes

  1. 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.
    
  2. login: "dgp"
  3. mimetype: "text/plain"