4 ms·
Yes, everything is a string. But you can pass data around anywhere you like without worrying about coercing. A command will receive its data in string represent
by mroll 10y ago
Yes, everything is a string. But you can pass data around anywhere you like without worrying about coercing. A command will receive its data in string representation and treat it however it likes. So when you go to do math with the 'expr' command, 'expr' will treat its arguments as numbers.
set x 5
expr { $x + 3 }
'expr' receives x as the string 5 but knows to treat it as an int.
I'm not sure that's a great explanation. Maybe a decent summary of the concept of 'no types' is "the language does not presume to tell you how you can or cannot use your data."
- vram22 10y agoThanks. Yes, I get it. I had read part of the Ousterhout book. And also Don Libes' Expect book uses Tcl, since Expect is written in it. Had read a lot of that too. Both very good ones. Didn't get to use Tcl in projects though. I'd read some years ago that Tcl was used heavily in the electronics / EDA industry.