Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f8af851b2db52bdf4aab15e799061d3ce98cc01b
Ticket: 898094ffffffffffffffffffffffffffffffffff
lreplace doesn't behave properly
User & Date: ramsunder on 2004-02-16 15:41:42
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    following lines are in a file names lreplace.test
    
    set line {'Bauelemente-Name ' '   GF' PIP BpEb SG 
    [Abmasse     [Abholposition [B
    estueckposition         [Abholort       
    [Zeiten              ] 'Position'}
    puts "line: $line"
    while { 1 } {
         set index [ lsearch -glob $line {\[*} ]
         if ![ string compare $index -1 ] then {
              break
         }
         set line [ lreplace $line $index $index DUMMY ]
          puts "line in while: $line"
    }
    puts "line after regsub: $line"
    
    
    
    running it on TCL shell, one will get the following result
    
    line: 'Bauelemente-Name ' '   GF' PIP BpEb SG 
    [Abmasse     [Abholposition [Bestueckposition         
    [Abholort       [Zeiten              ] 'Position'
    
    line in while: 'Bauelemente-Name ' ' GF' PIP BpEb SG 
    DUMMY {[Abholposition} {[Bestueckposition} 
    {[Abholort} {[Zeiten} \] 'Position'
    
    line in while: 'Bauelemente-Name ' ' GF' PIP BpEb SG 
    DUMMY DUMMY {[Bestueckposition} {[Abholort} 
    {[Zeiten} \] 'Position'
    line in while: 'Bauelemente-Name ' ' GF' PIP BpEb SG 
    DUMMY DUMMY DUMMY {[Abholort} {[Zeiten} 
    \] 'Position'
    
    line in while: 'Bauelemente-Name ' ' GF' PIP BpEb SG 
    DUMMY DUMMY DUMMY DUMMY {[Zeiten} \] 'Position'
    
    line in while: 'Bauelemente-Name ' ' GF' PIP BpEb SG 
    DUMMY DUMMY DUMMY DUMMY DUMMY \] 'Position'
    
    
    Just check in output line 2(line in while), second last 
    element, it get appended by "\" while in older version of 
    TCL, say 7.3(since I have that)
    
    This is not he behaviour and it is working fine., output of 
    lreplace command just shows me ] as second last 
    element of resultant list.
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.4.5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "ramsunder"
  9. subsystem changed to: "17. Commands I-L"
  10. title changed to: "lreplace doesn't behave properly"
  11. type changed to: "Bug"