From: SourceForge.net <no...@so...> - 2004-10-30 18:49:29
|
Feature Requests item #784359, was opened at 2003-08-06 15:32 Message generated for change (Comment added) made by kennykb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=784359&group_id=10894 Category: 07. Variables Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: Donal K. Fellows (dkf) Assigned to: Kevin B KENNY (kennykb) Summary: Tcl'2003: Unknown Array Element Callback Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Kevin B KENNY (kennykb) Date: 2004-10-30 14:49 Message: 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. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2004-03-29 04:02 Message: Logged In: YES user_id=79902 Handing this off to kbk; it was his idea originally ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2004-03-26 11:53 Message: Logged In: YES user_id=148712 dkf: comments? ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2003-08-06 15:51 Message: 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 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=784359&group_id=10894 |