Skip to content
Tcl Source Code History Of Ticket 784359ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 784359ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 784359ffffffffffffffffffffffffffffffffff

  1. Ticket change [ca05849bf7] (rid 122391) by dkf on 2003-08-06 19:32:58:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Yet another idea that cropped up at Tcl'2003:
      
      It should be possible to specify a callback for an
      array that is called whenever an attempt to access
      (read/write) a non-existant element is made. This would
      enable all sorts of cool things, according to KBK.
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dkf"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "Tcl'2003: Unknown Array Element Callback"
    11. type initialized to: "RFE"
  2. Ticket change [e29245a4fe] (rid 87654) by msofer on 2003-08-07 02:51:14:

    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"
  3. Ticket change [f639802301] (rid 130262) by msofer on 2004-03-26 23:53:07:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      dkf: comments?
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [567ac1a487] (rid 94323) by dkf on 2004-03-29 16:02:11:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Handing this off to kbk; it was his idea originally
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  5. Ticket change [35a7c5fa36] (rid 106977) by kennykb on 2004-10-31 01:49:27:

    1. closedate changed to: "2004-10-30T18:49:27"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      Was I sober at the time ?
      
      I certainly don't recall why I suggested such a thing, and
      Miguel's read-trace idea appears workable. 
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Rejected"
    7. status changed to: "Closed"
    8. username: "kennykb"
  6. Ticket change [aff630abce] (rid 97906) by msofer on 2004-10-31 02:23:15:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=148712
      
      Reopening - I like it; if it could be done in a manner that
      doesn't impact performance too much, it could be a VERY good
      way to define default values for arrays (and also dicts?).
      Save us a bunch of [info exists], and defining default
      values for [incr], etc.
      
      The idea could be generalised to variables, namespaces, ...
      Worth thinking about later on. 
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. priority changed to: "2"
    6. resolution changed to: "Postponed"
    7. status changed to: "Open"
    8. username: "msofer"
  7. Ticket change [13dbc486d7] (rid 261550) by serhiy.storchaka on 2026-11-13 11:18:45:

    1. closedate changed to: "2461357.9713335303"
    2. closer changed to: "serhiy.storchaka"
    3. icomment:
      Default values for missing elements are provided by array default (TIP 508, Tcl 9.0), which also works with incr and lappend. Read traces cover the general callback.
      
    4. login: "serhiy.storchaka"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Out of Date"
    7. status changed to: "Closed"