Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bcbe4f4ecbf0d03d186ef915adc32633699d2962
Ticket: 218253ffffffffffffffffffffffffffffffffff
comment sign (#) in switch body
User & Date: nobody on 2000-10-26 00:55:04
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2860 Bug
    Version: 8.1
    SubmitDate: '1999-09-21'
    LastModified: '1999-09-28'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Solaris
    OSVersion: 2.6.1
    Machine: Other
    FixedDate: '2000-10-25'
    ClosedDate: '1999-09-28'
    
    
    Name:
    William Yan
    
    Comments:
    To keep comment systax consistent, require user put curly braces "{...}"
        around the pattern or add backslash "\" right before hashmark "#" if
        he/she do want to treat the hashmark "#" as a pattern.
    
    ReproducibleScript:
    #!/bin/sh
        #Start Tclsh  exec tclsh $0 $@
        
        switch -regexp [lindex $argv 0] {
           # branch1: get input string "a"
           a {puts "input is a"}
           b {puts "input is b"}
           default {puts "input is neither a nor b"}
        }
        
        The above is the content of executable script file. Just run it in Unix
        shell.
    
    ObservedBehavior:
    The interprete look the first line in switch body
            # branch1: get input string "a"
        as a real branch although as my intent it was comment. And the
        interprete then reports error.
    
    DesiredBehavior:
    Add comments in switch body.
    
    
    
    This sort of comment placement is user error, as specifically
    stated in the switch man page.  The man page has been further
    updated for 8.3b1 to include an example of proper comment
    placement. 
    -- 09/28/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "comment sign (#) in switch body"
  11. type changed to: "Bug"