From: David S. C. <es...@sk...> - 2017-01-23 17:16:30
|
On Mon, 23 Jan 2017 04:44:31 +0000, you wrote: >So I propose a tweak to Bruce's question: *aside from debugging*, what uses can you think of, for catching all assignments to a particular variable? This reminded me of something I remember from Smalltalk and Java. This facility can be used for a "change listener" and to implement the observer pattern. https://en.wikipedia.org/wiki/Observer_pattern This can be fundamental to implementing a model-view-controller GUI. Something similar is in Tcl with the trace facility for variables. It allows some event-driven programming capabilities. Even if it's restricted to scalar global variables it can be useful, although it's more useful if scalar object variables or array object variables are allowed. It makes wiring up a persistence framework to a GUI presentation much simpler. escargo |