Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6dfb01141a095c0f46dc9fa1ceaf5ca730b265b6
Ticket: 1836519fffffffffffffffffffffffffffffffff
Make two-arg switch safe and fast
User & Date: pspjuth on 2007-11-22 15:21:07
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    When switch gets two arguments they cannot
    legally be options, yet they are scanned
    for options leading to that the simple way
    of coding:
    switch $a {
      xx yy
    }
    is not as safe as one would hope when $a
    happens to begin with "-".
    
    Not parsing for options where they cannot
    legally be are common in Tcl commands, e.g.
    lsort and lsearch does this.
    
    This patch makes the most straightforward
    switch usage also be the safest and fastest.
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "pspjuth"
  10. subsystem changed to: "18. Commands M-Z"
  11. title changed to: "Make two-arg switch safe and fast"
  12. type changed to: "Patch"