Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 602e0a6266a4bb2f9077275f23eedcc7aff8215d14842ba9d6b4ae9f6a6aadee
Ticket: 28cc67a606a7ab771af4c7b542b34ec1a377edc7
array set from dict: set values multi times on the same array is slower with Tcl9.0.
User & Date: sebres on 2024-04-16 20:27:31
Changes

  1. icomment:
    > The case is also present if SimplePERM proc returns an array.
    
    It doesn't "return an array", because it is currently impossible in tcl - [array get] returns a dict:
    
    ```
       % tcl::unsupported::representation [array get env]
       value is a dict with a refcount of 1, ..., no string representation
    ```
    Tcl cannot (and probably never will) directly return an array - array is just a complex variable (hash table in var in scope/NS/whatever), so [array get] generates a dict at the time of execution to be able to return it (basically for the same reason why one cannot return directly $env (that's as implemented in core-tcl, there are another tcl-engines which able to do that and even such where array and dict are the same stuff).
    
  2. login: "sebres"
  3. mimetype: "text/x-markdown"