Artifact 10506183e0d1bebc8fbe7a93a6f6acb69b123b92eaeab6cca2aca3dc805b5266:
- File doc/dev/value-history.md — part of check-in [0c11cb3cf8] at 2020-01-02 21:26:12 on branch dgp-review — next (user: dgp, size: 1128) [annotate] [blame] [check-ins using]
History of Tcl string values
Speculative and likely revisionist look back at Tcl strings.
Tcl programmers are familiar with the phrase Every value is a string. Discussions of this aspect of Tcl are found in many places. It is harder to find detailed discussions of precisely what is "a string" in Tcl, and how that precise definition has shifted over the years. This document is meant to tackle that task, based on a review of the changing interfaces and implementation in the Tcl source code itself.
Prehistoric Tcl (7.6)
NUL terminated array of char (C string)
The inspirations for the orignal Tcl string values were clearly the in-memory representations of C string literal values, and the arguments used by C programs to receive their command line.
int main(int argc, char **argv)
Every command in Tcl 7 is implemented by a Tcl_CmdProc with signature
int Tcl_CmdProc (ClientData, interp, int argc, char *argv[])
Tcl 8.0
Counted array of char
Tcl 8.1
Representation in an internal encoding