4 ms·
In TCL, everything is a sting, and its... certainly useful. https://wiki.tcl.tk/47683 https://wiki.tcl.tk/47683
by monetus 8y ago
In TCL, everything is a sting, and its... certainly useful.
https://wiki.tcl.tk/47683 https://wiki.tcl.tk/47683
- jerf 8y agoIt isn't, really. Everything has a transform to a string, and in a pinch, everything can be converted to a string, have string operations performed on it, and converted back to the target type transparently, but under the hood, TCL uses numbers and such whenever possible. If you add ten number together, at most, it'll convert ten strings to numbers; it doesn't convert the first two strings to a number, add them, convert that back to a string, the convert the partial total back to a number and the third number to a number to add them, etc. The language implements a string-based interface to everything, but the runtime is not literally dealing in nothing but strings.
- monetus 8y agoYes, an important distinction, called shimmering, in case anyone was wondering. Regardless of being a seemingly double-edged sword, I feel like that structure is fascinatingly useful. I've yet to utilize the C api or delve into the intricacies of tcl_obj, so I still feel one edge is sharper than the other. I mean, look at the diagram of how type inference may work in the tclQuadCode wiki and try not to say 'whoa' https://wiki.tcl.tk/3033 https://wiki.tcl.tk/3033 - shimmering https://wiki.tcl.tk/40985 https://wiki.tcl.tk/40985 - tclQuadCode https://wiki.tcl.tk/47683 https://wiki.tcl.tk/47683 - type diagram