Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7510481835cf1e1a049118d1944c30674c830871
Ticket: 449094ffffffffffffffffffffffffffffffffff
Read trace on arrays (ex "Tcl_TraceVar")
User & Date: msofer on 2001-08-10 07:35:19
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    
    Doh ... At least I understand now why these scripts fail to
    do what I thought they would do: Tcl_TraceObjCmd (in
    tclCmdMZ.c) does not set the flag TCL_TRACE_ARRAY, the read
    trace fires when an element of the array is read and not on
    [array]. 
    
    Using the (new in 8.4, still not documented/oficial) [trace]
    command, the bug is exposed to scripts: array trace still
    does not fire on first access if the variable is undefined:
    
    % trace add variable rotvar array {set rotvar(foo) 1 ;#}
    % array names rotvar
    % array names rotvar
    foo
    
    
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. title changed to: "Read trace on arrays (ex "Tcl_TraceVar")"
  5. username: "msofer"