Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 248e4dd6db6325996a06994edbfed1e0a5585c6b
Ticket: 2889293fffffffffffffffffffffffffffffffff
[info exists array(elem)] deletes array searches
User & Date: msofer on 2009-10-30 17:15:54
Changes

  1. assignee changed to: "dkf"
  2. icomment:
    The BC implementation has to mimic exactly the non-compiled implementation. 
    
    As [info exists] triggers read traces on the array and the traces could well create new elements, the effect on searches is inevitable (or at least very hard to avoid).
    
    The comments at the start of TclVarTraceExists attempt an explanation:
    
        /*
         * The choice of "create" flag values is delicate here, and matches the
         * semantics of GetVar. Things are still not perfect, however, because if
         * you do "info exists x" you get a varPtr and therefore trigger traces.
         * However, if you do "info exists x(i)", then you only get a varPtr if x
         * is already known to be an array. Otherwise you get NULL, and no trace
         * is triggered. This matches Tcl 7.6 semantics.
         */
    
    
    
    
  3. login: "msofer"
  4. mimetype: "text/plain"
  5. subsystem changed to: "17. Commands I-L"
  6. username: "msofer"