3 ms·
And JS :-). let x = ()=>42 let y = ()=>42 let z = ()=>x()+y() z() // 84 y = ()->69 z() // 111
by repsilat 8y ago
And JS :-).
let x = ()=>42
let y = ()=>42
let z = ()=>x()+y()
z() // 84
y = ()->69
z() // 111
- geocar 8y agoNot exactly the same thing, for one these aren't function calls, and for another the view is memoized: You can see the difference with some print statements: 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 138
- wool_gather 8y agoWell, you can do that in any language with first-class functions. But there's obviously a syntactical difference between a function invocation and a variable read.