by c3534l · 7y ago · 0 comments
z::x+y
x:42
y:42
z
y:69
z
[1]: https://code.kx.com/v2/ref/view/ let x = ()=>42
let y = ()=>42
let z = ()=>x()+y()
z() // 84
y = ()->69
z() // 111 q)z::show(x;y;x+y);x+y
q)x:42
q)y:42
q)z
42 42 84
84
q)x:69
q)z
69 42 111
111
q)z
111
Views are also aware of what's changed: q)a:1234
q)z
111
q)y:69
q)z
69 69 138
138Granted, you need to use something like the ST monad to be able to "change the value of x," but once you do, all other values fall into place like dominoes.