Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c17a0cfb614b429edcb32ae0d0f3018d703725daba7836a916aabd3d3d8def5b
Ticket: 3a24cc9df1619a130120e8cef8560aef0561c1f0
Switch statement case fails when using a open parenthesis in a comment
User & Date: mookie on 2025-04-12 22:44:41
Changes

  1. comment changed to:
    Example code:
    
    proc yay {lang} {
        switch $lang { 
            tcl { 
    	    puts "Yay! TCL"
                # having a a { will break this case now
            }
        }
    } ;# end proc
    
    I then have to apply an additional { to the code which results in 
    invalid command name "}"
    
    }
    % yay_lang "tcl"
    Yay! TCL
    invalid command name "}"
    
    Not sure feature, or bug, so feel free to close, but surely a comment is a comment and shouldn't be executed? I recall correctly it's down to that switch cases are executed as lists. But something feels eery that you can't use a { in a comment.
    
  2. login: "mookie"
  3. mimetype: "text/plain"