3 ms·
You can have any type you want, as long as it's a string. :-) Don't forget about https://core.tcl-lang.org/expect/index https://core.tcl-lang.org/expect/index
by keithalewis 3y ago
You can have any type you want, as long as it's a string. :-)
Don't forget about https://core.tcl-lang.org/expect/index https://core.tcl-lang.org/expect/index. Comes in very handy sometimes.
- kevin_thibedeau 3y agoTcl hasn't been string based for over 20 years. It's time for this myth to die.
- tyingq 3y agoIf it's a myth, the myth seems driven by the TCL team itself. https://wiki.tcl-lang.org/page/everything+is+a+string https://wiki.tcl-lang.org/page/everything+is+a+string Yes, there is some detail about internal dual representation.
- kevin_thibedeau 3y agoThat wiki page has been around since before Tcl 8. Nobody says lisp is hampered because everything is an S-expr.
- tyingq 3y ago> That wiki page has been around since before Tcl 8 Maybe, but it's clearly been updated after Tcl 8. And while the page itself isn't calling it something that hampers tcl, it does cover that it's somewhat unusual, that is has implications, and so on.
- dkfellows 3y agoTechnically, all values are considered subtypes of strings, but the notion of types is quite different to those of many other languages. In particular, Tcl's types do not describe the memory storage model of their values. (They're implemented with 64-bit words and buffers and arrays and so on, but that's not what the value model describes.) It works well as long as your goal isn't to totally eliminate boxing of values.
- zylent 3y agoafter using expect and TCL heavily for years, I can firmly say they suck at scale. Ruby https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/ios.rb https://github.com/ytti/oxidized/blob/master/lib/oxidized/mo... or TextFSM https://github.com/google/textfsm https://github.com/google/textfsm are much better options if you need to do a /lot/ of parsing
- cpeterso 3y agoTcl may not be strongly typed, but it is "stringly typed". :)