Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7689f6612c310028a6ad59975e48c76af35ca0f4f635bd035eb74d3631f9a565
Ticket: 67d5f75c36cbada6cf2361aaf49cffa61281143b
[$interp eval $lambda] after [eval $lambda] or vice versa fails
User & Date: dbohdan on 2024-09-29 13:23:29
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    The following code generates an error with a blank message in Tcl 9 but succeeds in Tcl 8.6.
    The error seems to only occur when:
    
    - You use a `[list]` command to create the anonymous function. It does not occur with a braced string.
    - The contents of the list is `apply ...` rather than, for example, `puts hi`.
    
    `[eval]` and `[$interp eval]` can be called in either order;
    the second one fails.
    
    ## Code
    
    
    ```tcl
    set lambda [list apply {{} {
        puts hi
    }}]
    
    puts [list [info patchlevel] {*}[array get tcl_platform]]
    
    eval $lambda
    set interp [interp create]
    $interp eval $lambda
    ```
    
    This is the contents of the file `tests/all.tcl` in the log.
    
    ## Log
    
    ```none
    > tclsh8.6 tests/all.tcl
    8.6.14 osVersion 6.8.0-44-generic pointerSize 8 byteOrder littleEndian threaded 1 machine x86_64 platform unix pathSeparator : os Linux engine Tcl user dbohdan wordSize 8
    hi
    hi
    
    > tclsh9.0 tests/all.tcl
    9.0.0 osVersion 6.8.0-44-generic pointerSize 8 byteOrder littleEndian machine x86_64 platform unix pathSeparator : os Linux engine Tcl user dbohdan wordSize 8
    hi
    
        while executing
    "apply {{} {
        puts hi
    }}"
        invoked from within
    "$interp eval $lambda"
        (file "tests/all.tcl" line 11)
    ```
    
  5. foundin changed to: "9.0.0"
  6. is_private changed to: "0"
  7. login: "dbohdan"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "f4b679459a3c52d67a51ecd06fa3fba663ebe607"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "dbohdan"
  14. subsystem changed to: "20. [interp]"
  15. title changed to:
    [$interp eval $lambda] after [eval $lambda] or vice versa fails
    
  16. type changed to: "Bug"