Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e29245a4fe5f2cf6f907052afa27cafeae1a2e2e
Ticket: 784359ffffffffffffffffffffffffffffffffff
Tcl'2003: Unknown Array Element Callback
User & Date: msofer on 2003-08-07 02:51:14
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    
    I guess I didn't understand: in what respect is the
    trace-based solution short of what's requested? Oris it just
    a matter of performance?
    
    % proc readTrace {name1 name2 op} {
            upvar 1 $name1 ary
            if {![info exists ary($name2)]} {
                puts "Non-existent element: set to \"z\""
                set ary($name2) z
            }
        }
    % array set a {1 a 2 b}
    % trace add variable a read readTrace
    % set a(1)
    a
    % set a(2)
    b
    % set a(3)
    Non-existent element: set to "z"
    z
    
    
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. username: "msofer"