In the next release of 8th I'm adding monitors. They're implemented in
the dev-version right now.
https://8th-dev.com/forum/index.php/topic,1292.msg6942.html
The idea is that you can monitor a variable and be informed when it
changes value.
My implementation works for the 8th types "var", "array", and "map". The
implementation uses an array of words which are invoked if the
underlying container is modified.
So e.g.
: monitor @ . cr ;
var x
x ' monitor +monitor
123 somevar !
would print "123", since the monitor word gets invoked with the var on TOS.
If the container is an array, then the array as well as the affected
index are passed to the monitor. If it's a map, the map and the key are
passed in.
The purpose I had in adding this was to make it easy for a GUI
application to update or modify itself based on some dynamic
information. Haven't actually done anything with it, yet.