Skip to content
Tcl Source Code History Of Ticket 898094ffffffffff
Login

History Of Ticket 898094ffffffffff

Artifacts Associated With Ticket 898094ffffffffff

  1. Ticket change [f8af851b2d] (rid 91584) by ramsunder on 2004-02-16 15:41:42:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "obsolete: 8.4.5"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "ramsunder"
    9. subsystem initialized to: "17. Commands I-L"
    10. title initialized to: "lreplace doesn't behave properly"
    11. type initialized to: "Bug"
  2. Ticket change [5f5b29b7aa] (rid 115807) by dkf on 2004-02-18 04:13:50:

    1. closedate changed to: "2004-02-17T21:13:50"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      This isn't a bug.  The semantics of [lreplace] (and quite a
      few other list operations) were deliberately changed in Tcl
      8.0 (which is itself many years old now) to no longer
      guarantee that minimal alterations to the string were made,
      a sacrifice which allows much more aggressive and efficient
      list handling overall.  Note that element-wise comparison
      with what you would expect to get out of Tcl 7.3 should
      still yield equal lists; they are just not expressed using
      the same string.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "dkf"