|
|
|
|
|
by toraobo
2420 days ago
|
|
> And yes - the list quoting rules are weird! No doubt about that. Lists might be "native" in the sense that the interpreter knows how to deal with them but in the data model there is no distinction between a "string" and a "list of strings". A list is just a space-separate string with quoting rules and the difference is entirely in manipulation. It's easy to make quoting mistakes so a program might start breaking when arguments contains spaces: this almost never happens in languages other than shell. |
|
This has not been true since the release of Tcl 8.0 that added the Tcl_Obj subsystem.
Lists in modern Tcl (8.0+, with 8.0 released in 1997) are proper O(1) indexed arrays. Yes, you can still request from Tcl the 'string' representation of the O(1) indexed array, and the result you get is the old (pre 8.0) "space-separate [sic] string with quoting rules" variant that will parse back into the O(1) indexed array later if you want.
But Tcl lists have not been /only/ those strings for a very long time.