Artifacts Associated With Ticket 3a24cc9df1619a13
Ticket change [abeebf93f1] (rid 239032) by mookie on 2025-04-12 22:42:59:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
Example code: proc yay {lang} { switch $lang { tcl { puts "Yay! TCL" # having a a { will break this case now } } } ;# end proc yay "tcl" 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. - foundin initialized to: "9.x"
- is_private initialized to: "0"
- login: "mookie"
- priority initialized to: "5 Medium"
- private_contact initialized to: "eb7513005aa11dbe2a07d8bff76f8af3c25f379b"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "mookie"
- subsystem initialized to: "69. Other"
- title initialized to:
Switch statements case statements fail with open parentheis in comments
- type initialized to: "Bug"
Ticket change [2be0e11855] (rid 239033) by mookie on 2025-04-12 22:43:40:
- comment changed to:
Example code: proc yay {lang} { switch $lang { tcl { puts "Yay! TCL" # having a a { will break this case now } } } ;# end proc yay "tcl" % proc yay_lang {lang} { switch $lang { tcl { puts "Yay! TCL" # having a a { will break this case now } } } ;# end proc } % 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. - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [c17a0cfb61] (rid 239034) by mookie on 2025-04-12 22:44:41:
- 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. - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [ca870d1eb8] (rid 239035) by mookie on 2025-04-12 22:45:11:
- comment changed to:
Example code: proc yay {lang} { switch $lang { tcl { puts "Yay! TCL" # having 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. - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [127b1ab3c2] (rid 239036) by mookie on 2025-04-12 22:45:50:
- comment changed to:
Example code: proc yay {lang} { switch $lang { tcl { puts "Yay! TCL" # having this { 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. - login: "mookie"
- mimetype: "text/plain"
- title changed to:
Switch statement case fails when using a open parenthesis in a comment
- comment changed to:
Ticket change [3403614bce] (rid 239037) by mookie on 2025-04-12 22:48:16:
- comment changed to:
Example code: proc yay {lang} { switch $lang { tcl { puts "Yay! TCL" # having this { will break this case now } } } ;# end proc I then have to apply an additional { to the get the syntax to execute but results with invalid command name "}" % yay "tcl" Yay! TCL invalid command name "}" Not sure feature, or bug; so feel free to close. Surely a comment is a comment and shouldn't be executed? If recall correctly it's down to that switch cases are executed as lists. FWIW. - login: "mookie"
- mimetype: "text/plain"
- priority changed to: "2"
- comment changed to:
Ticket change [ff6dcaf77d] (rid 239038) by griffin on 2025-04-12 23:57:56:
- icomment:
This behavior is expected. Tcl is not parsed like other programming languages. It is an organized collection of strings that can be evaluated to do things. Read this man page carefully. https://www.tcl-lang.org/man/tcl8.6/TclCmd/Tcl.htm It defines everything you need to know about Tcl. This is an over simplification: There is no “comment” in Tcl. Instead, commands that start with a # are ignored. I hope this helps.
- login: "griffin"
- mimetype: "text/x-fossil-plain"
- icomment:
Ticket change [3b8cbf15dc] (rid 239626) by mookie on 2025-04-28 14:19:16:
- closedate changed to: "2460794.09672155"
- closer changed to: "mookie"
- icomment: "Many Thanks."
- login: "mookie"
- mimetype: "text/plain"
- status changed to: "Closed"
Ticket change [6e7284f52c] (rid 239663) by pooryorick on 2025-05-02 07:48:56:
- closedate changed to: "2460797.825652"
- closer changed to: "pooryorick"
- login: "pooryorick"
- mimetype: "text/plain"
- resolution changed to: "Invalid"