4 ms·
I think the problem with such systems is that they have to contend with the infinite varieties of ways references can be stashed away. When a local is itself a
by int_19h 9y ago
I think the problem with such systems is that they have to contend with the infinite varieties of ways references can be stashed away. When a local is itself a reference string, that's well and good. What if it's a string that has a reference embedded in it somewhere? But that effectively describes all Tcl data structures...
- flafoar 9y agoYes, the way I was looking at strong/weak references was that strong references could only be held as a value in local/global/class variables, including in lists and dictionaries. And converting a strong reference to a string would give you a weak reference. So you wouldn't be able to, say, convert a list that included a strong reference to a string, then convert the string back to list, and have exactly the same list that you started with because the strong reference in the original list would be a weak reference in the resulting list. Strings can represent list and dictionary data structures, and combinations of, but I'm not sure that strings represent all Tcl data structures in the same way. I'm thinking of Tcloo and Tcl arrays - I don't use those and know little about them.