Function tclList

  • This encodes a list of strings in the TCL format.

    TCL lists and programs are inspired by shell script. A space separates two adjacent items. If a list item contains a space (or other special character) we quote the item. Any valid unicode string is a valid list item, including the output of previous calls to tclList(). In fact the format is optimized for recursive lists.

    tclList(a, b, c) in JavaScript is the same as [list $a $b $c] in TCL.

    If the items are strings, they are encoded in the normal TCL way. If an item is a boolean, it is first converted to "1" or "0". If an item is a number, it is converted to a string in the default way. If an item is an array, tclList() recursively calls itself.

    For the unquoting rules, see http://tmml.sourceforge.net/doc/tcl/Tcl.html

    Parameters

    • list: Iterable<TclListable, any, any>

      The items to encode in a single string.

    Returns string

    The list in TCL format.