Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: eafccc81834624fce9a628197ad3cf6eacdb75d2
Ticket: 47ac84309bab4719c58a693f5d63d837887f3b17
more (compiled) lreplace madness
User & Date: oehhar on 2015-06-22 15:39:32
Changes

  1. comment changed to:
    in chasing [44fd4b9a4e], another edge case with compiled lreplace:
    
    <pre>% lreplace {a b c} end 0
    !! {a b c} != {a b b c}
    % lreplace {a b c} end 0 A
    !! {a b A c} != {a b A b c}</pre>
    
    
    In each case the LHS is the interpreted & correct answer, RHS compiled & incorrect.
    
    Test script:
    
    <pre>proc check {cmd} {
        puts "% $cmd"
        proc t {} $cmd
        set rc [t]
        set ri [uplevel 1 $cmd]
        if {$ri ne $rc} {
            puts "!! [list $ri != $rc]"
        } else {
            puts "ok [list $rc]"
        }
    }
    
    foreach {a} {
        0 1 2 3 end-3 end-2 end-1 end
    } {
        check [list lreplace {a b c} end $a]
        check [list lreplace {a b c} end $a a]
    }</pre>
    
  2. icomment:
    Exchanged "correct" and "incorrect" in the description.
    I hope this is correct.
    
    Harald
    
  3. login: "oehhar"
  4. mimetype: "text/x-fossil-wiki"
  5. username: "oehhar"