Skip to content
Tcl Source Code History Of Ticket 1106138
Login

History Of Ticket 1106138

Artifacts Associated With Ticket 1106138

  1. Ticket change [ef5919aa13] (rid 108974) by ruffrecords on 2005-01-20 17:26:11:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I propose the addition of an option to the switch command to 
      allow integer comparisons much like the switch statement in C. 
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "ruffrecords"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "Integer option to switch command"
    11. type initialized to: "RFE"
  2. Ticket change [5821747fd5] (rid 117748) by dkf on 2005-01-21 15:56:19:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Matter was discussed on c.l.t:
      http://groups-beta.google.com/group/comp.lang.tcl/browse_frm/thread/a0b1398ff0b42638/66809fe88969cd04?_done=%2Fgroup%2Fcomp.lang.tcl%3Fhl%3Den%26&_doneTitle=Back+to+topics&_doneTitle=Back&&d#66809fe88969cd04
      
      Idea is that this should work as (arithmetically) expected:
        switch -integer [expr {int(sqrt(4))}] {
           0x00 { puts "root 4 is zero" }
           0x01 { puts "root 4 is one" }
           0x02 { puts "root 4 is two" }
        }
      
      i.e. We want an option for [switch] to use ==-like equality
      as well as eq-like equality. For the bytecode-compiled
      version, this is almost trivial (add check-integer and use
      INST_EQ instead of INST_STR_EQ) but it is a bit more work
      for the non-BC version.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [dfe3f2b683] (rid 261509) by serhiy.storchaka on 2026-11-13 11:18:43:

    1. closedate changed to: "2461357.9713335303"
    2. closer changed to: "serhiy.storchaka"
    3. icomment:
      Implemented in Tcl 9.1 by TIP 730: switch -integer compares the value and the patterns as integers, so the example above matches 0x02.
      
    4. login: "serhiy.storchaka"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"