Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e4d1d6bcb5980b85cb5b229ae145d9c12a88cff66fb52f81b7b9880933024606
Ticket: 3057b6261f7b7ac748fee8c2915c516d2bf05ffa
Allow ':' (';' on Windows) as separator in TCLLIBPATH
User & Date: pooryorick on 2024-10-19 08:49:17
Changes

  1. icomment:
    The Tcl list format is the best choice for representing data in a
    platform-agnostic manner.  This includes structured data that is stuffed into
    environment variables.  One thing that is underappreciated is that when items
    in a Tcl list are enclosed in double quotes, with characters in the enclosed
    value properly escaped, the Tcl list is readable by both Tcl and a Posix shell.
    That is, it is trivial to write an sh function that produces a Tcl list, and
    then for either an sh or Tcl interpreter to consume that same list.  This is
    how the list can be consumed in sh:
    
    <code><verbatim>
    mylist="\"one two\" \"three four\" \"five six\""
    eval set -- $mylist
    for i in "$@"; do printf '%s\n' "$i"; done
    </verbatim></code>
    
    If Tcl standardizes on using Tcl lists to communicate structured data, each
    existing and future platform can easily adapt the data to meet its own needs.
    It also allows the implementation of Tcl itself to remain more simple.  When
    the format of TCL_PACKAGE_PATH was changed recently, the following code was
    added to parse the foreign format:
    
    	https://core.tcl-lang.org/tcl/info/c2a94d79f639037e
    
    Accretions of such add-hoc parsing in the Tcl code base over time are clearly
    undesirable. Standardizing on Tcl lists offers a way to stay out of such
    messes.
    
  2. login: "pooryorick"
  3. mimetype: "text/x-fossil-wiki"