I would like to have a comment inside the command, and this seems impossible, given that the "#" character is defined in Tcl 8.4 as follows:
If a hash character (`` # '') appears at the point where Tcl expects the first character of the first word of the command, then the hash character and subsequent characters passing through the next new line are considered as comments and are ignored. The comment symbol only matters when it appears at the beginning of the command.
Imagine an example of how this might work (none of these comments worked in my experiments):
array set myArray [list red 3 \
blue 4 ;# Blue is before purple.
purple 5 # Purple is after red.
green 7 \
yellow 8]
It seems the tricky part is how to continue the list command with inline comment? Perhaps something like the C ++ style in the / * Embedded comment. * /, but I see only #, which is used in Tcl for comments to the end of the line, nothing for the syntax of the beginning and end of the comment.
source
share