Skip to content
Tcl Source Code History Of Ticket 8cd74c5cd2
Login

History Of Ticket 8cd74c5cd2

Artifacts Associated With Ticket 8cd74c5cd2

  1. Ticket change [4c5bf8f1f5] (rid 242453) by jan.nijtmans on 2025-07-12 16:36:22:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      According to the documentation:
      <pre>
      If first is specified, it refers to the first char index in the string to start modifying
      </pre>
      The documentation doesn't specify what happens if _last_ is not specified, but this suggests that modification of the string will be done until the end (just as when neither _first_ and _last_ are specified). That's not what happens:
      <pre>
      $ tclsh8.6
      % string tolower ABC 1
      AbC
      </pre>
      Reading the documentation, I would expect "Abc" as the answer. So, either the documentation or the implementation should change.
      
      I'm not 100% sure, but I'm leaning towards changing the documentation.
      
    5. is_private initialized to: "0"
    6. login: "jan.nijtmans"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "0c50e5320704d174412e57b873d8932de15303e0"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "jan.nijtmans"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to:
      2-argument string toupper/tolower/totitle doesn't work as documented
      
    15. type initialized to: "Bug"
  2. Ticket change [ee115fd65f] (rid 242458) by jan.nijtmans on 2025-07-12 16:48:19:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Commit [83bd3ccec5ec1208] contains both the documentation change (which adapts the documentation to the current behavior) and the implementation change (which adapts the implementation to the current documentation.
      
      Please review: Should "string tolower ABC 1" result in "Abc" (as it currently does) or "Abc" (as the documentation suggests)?
      
      I couldn't find any code which uses "string tolower/toupper/totitle", specifying _first_ but not _last_. But changing the implementation is a risk.
      Therefore I'm leaning towards changing the documentation. But if you don't agree with that (or if you agree with that), please let me know!
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  3. Ticket change [7e4bda18ae] (rid 242459) by jan.nijtmans on 2025-07-12 16:50:37:

    1. login: "jan.nijtmans"
    2. mimetype: "text/plain"
    3. subsystem changed to: "18. Commands M-Z"
  4. Ticket change [6e9c512618] (rid 242460) by sebres on 2025-07-12 17:26:14:

    1. icomment:
      I'm also for documentation change...<br/>
      Just because this behaviour (first is just an index without last) is at least since 8.5 (if not earlier), so even if actual docu says something different, the code works as it works everywhere dozen years and there is no one reason to change the behaviour of tcl for the sake of documentation.
      
      Especially because it is pretty simple to force the change case to the end, with supplying the `last` as `end` (to cause "documented" behaviour):
      
      ```
      % string tolower ABCDE 2
      ABcDE
      % string tolower ABCDE 2 end
      ABcde
      ```
      
      @Jan, by the way, you wrote the same statement (result) for both variants, so here again (and a bit more clear example):
      
      ```
      # if the code wins:
      % string tolower ABCDE 2
      ABcDE
        \------- only given index
      
      # if the docu wins:
      % string tolower ABCDE 2
      ABcde
        \-/ ---- from given index to end
      ```
      
    2. login: "sebres"
    3. mimetype: "text/x-markdown"
  5. Ticket change [617d0f4961] (rid 242461) by sebres on 2025-07-12 17:27:53:

    1. icomment:
      > I couldn't find any code which uses "string tolower/toupper/totitle"
      
      Even not in our test suite? That would be worse.
      
    2. login: "sebres"
    3. mimetype: "text/x-markdown"
  6. Ticket change [727af828cd] (rid 242462) by jan.nijtmans on 2025-07-12 19:21:03:

    1. icomment:
      > Even not in our test suite? That would be worse.
      
      In our test suite, yes. But not anywhere else (not even in Tk)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [4e16c285cc] (rid 242607) by jan.nijtmans on 2025-07-13 08:32:24:

    1. closedate changed to: "2460869.85583772"
    2. closer changed to: "jan.nijtmans"
    3. icomment: "Documentation updated in all branches"
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"