Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ac9f99f443a0d48c0d1fdb5f6139e3bc49042fe4aa4f085fc24a3e6629a4a087
Ticket: 141c6f5621e9c9e881f63fbf28c473955b6adae0
[string length] reports a length of 2 for a single character
User & Date: dgp on 2022-03-07 15:15:02
Changes

  1. closedate changed to: "2459646.13545057"
  2. closer changed to: "dgp"
  3. icomment:
    
    The troubling disruptions are mostly in the inferences programmers
    have been able to make that have been invalidated by the change.
    As an example, whenever
    
      (string length [string index $s $i] == 0) && ($i >= 0)
    
    a programmer could reliably conclude
    
       [string length $s] < $i
    
    without making any additional tests.  Any program built on inferences
    like that are at risk through this transition.
    
    Tcl 9 then reverses course and transitions back to:
    
    % string length 💣
    1
    % string index 💣 0
    💣
    % string index 💣 1
    % 
    
    I think this double transition back to where we started is
    fueling the stated plans of several people to skip Tcl 8.7 altogether.
    
  4. login: "dgp"
  5. mimetype: "text/plain"