Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 65e121a697ff4a7b82a344a676c49c73ba41a11f6fc083924a874d55da52b8c7
Ticket: 6ee2f5d5d6bc7d697b735f5389d833ff9e61e217
Tcl 9.0 "invalid character in array index" error for $a("b")
User & Date: avl42 on 2026-07-30 09:11:24
Changes

  1. icomment:
    This is a necessary regression that had to happen at a major version shift, to pave the way for some extension in expr lateron.
    
    The change does not affect setting of variables, but it affects specifically the syntax for retrieving array-elements.
    
    In tcl 8 you could also do weird things like puts $a(((), if "((" was among the keys in the array; but no longer in Tcl 9.
    
    Btw., the following variants continue to work:
    # escaping the special characters, if they need to be given literally:
    puts $a(\"b\")
    set a((() z; puts $a(\(\()
    # any chars can still be used via substitution:
    set key {"b"}; puts $a($key)
    foreach k [array names a] {puts "$k: $a($k)"}
    
  2. login: "avl42"
  3. mimetype: "text/plain"
  4. username: "avl"