3 ms·
>comment character Yes the comment syntax can be infuriating if you're not ready for it. This might not be true any longer, but a number of years ago when I w
by na85 12y ago
>comment character
Yes the comment syntax can be infuriating if you're not ready for it.
This might not be true any longer, but a number of years ago when I was still using Tcl,
# this was a valid comment
#this was not a valid comment
due to the parser reading "# this" as a comment token followed by its string arguments (I guess it's semantically a noop that takes a string arg) and "#this" which threw an invalid token error.
Coming from C/C++ it drove me nuts.
- towelrod 12y agoAlso in the older tcl (not sure about 8.5+), it would parse { characters inside comments as if they were real braces in the code. So if you put a comment like: # I want to escape the { in the next line then it would cause your code to fail because of unbalanced { characters.
- krupt 12y agoNope, sorry, that was never true. I just peeked at the source for 2.1 (which is on sourceforge) and comments are the same as today.