Artifacts Associated With Ticket 32dd97149b
Ticket change [b69dcdad95] (rid 203418) by anonymous on 2022-08-29 07:02:13:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
Hi, put code down in a "extra2.test" file and call it with : tclsh extra2.test 1 or 2 or 3 =============================== lassign $argv num if { $num == 1 } { puts 1 # } elseif { $num == 2 } { # # puts 2 } else { puts 99 } ================================= > tclsh extra2.test 1 1 > tclsh extra2.test 2 !! nothing !! > tclsh extra2.test 3 99 - foundin initialized to: "tclsh8.6"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "cfa5542303e02522a952e7e43ae9583a052b31e9"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "None"
- title initialized to: "tcl comment syntax BUG"
- type initialized to: "Bug"
Ticket change [332cdb59b5] (rid 203433) by jan.nijtmans on 2022-08-29 12:39:46:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459821.02762597"
- closer changed to: "jan.nijtmans"
- icomment:
This is not a bug, but it's how the Tcl parser works. Everything between '{' and '}' is always taken literally and fed to the command, the command is fully responsible for interpreting this string. In case of 'if', the command interprets the 3th argument as code, which contains a last line starting with '#' and ends just before '}'. So the effect of the first '#' ends with the following '}', not at the end of the line. Hope this helps, Jan Nijtmans - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Invalid"
- status changed to: "Closed"