3 ms·
> Quoting is insane and hard to get right. On the contrary, compared to e.g. bash, unless you're doing something super unusual or wrong, you rarely have to thi
by andrewshadura 4y ago
> Quoting is insane and hard to get right.
On the contrary, compared to e.g. bash, unless you're doing something super unusual or wrong, you rarely have to think about quoting in Tcl. Use "" when you want substitution, {} when you don't, {*} when you need to pass a list as multiple words, construct lists and dicts using their appropriate constructors and never by hand — and you're safe. Unlike bash, quoting in Tcl is dead simple, predictable and never surprising.
- oddthink 4y agoI do prefer tcl quoting to bash quoting, but you do have some mental overhead when writing procedures, since unpaired braces inside quotes may do surprising things, if you're thinking "writing a command" rather than "raw strings". Comments are similar. That being said, those are very much edge cases. More damning, from my POV, is that you can't get ref counting of things like C objects or file handles, since they're just string handles. But there are a lot of uses that don't need that
- IshKebab 4y agoYes it's not as bad as some other stringly typed languages, but compare it to literally any other language with proper types. Even terrible ones like PHP don't have those issues.