Overview
| Artifact ID: | 3630a0d815c6efac94521558912932718a74e4cf4e37801482526b00e93fbef3 |
|---|---|
| Ticket: | 1b8a893ded5f2a9b0c70a5893c7a2be3429d8033
TCL_PACKAGE_PATH path is (wrongly) braced. |
| User & Date: | pooryorick on 2025-05-09 09:48:55 |
Changes
- icomment:
Hi Harald, the main use case is consumption by or for a Tcl interpreter. TCL_PACKAGE_PATH and TCLLIBPATH are intended for consumption by a Tcl interpreter, so they really should be Tcl lists. It's backwards to modify TCL_PACKAGE_PATH, which is intended for consumption by a Tcl intepreter, so that it is in the native format of another language. Doing this complicates the task of reading it for a Tcl interpreter, and there will surely be future bug reports because of this complication. Since these variables happen to be exposed in the environment, non-Tcl programs have access to them, but they were intended to be passed through to a Tcl interpreter, not directly used in another language. Even so, in [3057b6261] I described how the Tcl list format can trivially be consumed by sh-family languages, so not only is the Tcl list format the correct format for values that are intended to be read by Tcl interpreters, but it is also a good standard format for consumption by other languages. The Tcl list format is in many cases actually more convenient for other languages, because these days a shell script like tclConfig.sh which was produced on one platform might for one reason or another be consumed on another platform. In this case, a Tcl list is more convenient than trying to keep track of all the item delimiters one might encounter out in the wild. This change already "sort of broke" dgp's OOMMF package, and it caused some indigestion for some of my own scripts as well. There are many variables in tclConfig.sh that are intended for use in an sh script, and not intended for consumption by a Tcl interpreter. For many of those variables, the Tcl list format does not make sense, but for TCL_PACKAGE_PATH and TCLLIBPATH, the only format that makes good sense is the Tcl list format. The issue that occurred in the TCLTLS can just as easily be solved by having the related shell scripts treat TCL_PACKAGE_PATH as a Tcl list, which as I have already shown, they can easily do. It's not worth it to keep this broken "fix" in place just because it has been incorporated downstream in a few places. It's easy to get short-sighted by being too oriented on a particular use case and fixing things for that use case, only for a conflicting use case to appear later. If the principal is that the Tcl list format should be used for structured values intended for consumption by a Tcl interpreter, further implementation complications and user issues will be avoided. A peek at the implementation of the "fix" for this report bears that out. If the "fix" for this issue isn't reverted, then [3057b6261] is probably eventually going to get resolved by applying it to TCLLIBPATH as well, which will probably cause even more complications and user issues.
- login: "pooryorick"
- mimetype: "text/x-fossil-wiki"