2 ms·
If # were a comment character in the language you could do this: % puts "hello" # hello bad argument "hello": should be "nonewline" But this works:
by gaius 18y ago
If # were a comment character in the language you could do this:
% puts "hello" # hello
bad argument "hello": should be "nonewline"
But this works:
% puts "hello" ;# hello
hello
That's the point; that nothing in Tcl is "special" or "reserved", everything is a command that takes parameters.
- kragen 18y agoI didn't remember that you can't have a comment inside of a statement, but you're still wrong! It's true that you can't have comments in as many contexts in Tcl as you can in most languages, but it is not true that they are just ordinary statements; ordinary statements evaluate their arguments. "#" comments don't evaluate their "arguments", don't terminate at semicolons, and you can't redefine the meaning of "#" with "proc", so "#" is special and reserved — just in fewer contexts than in other languages that use it as a comment character.