Hacker News new | ask | show | jobs
by icsa 1546 days ago
Views in k/q. A view is like a variable whose value is determined by a dependency expression.

/ any time c changes, f will be updated f::32+1.8c / temp (F) from temp (C)

/ any time m or x or b change, y will be updated y::bm*x

Lots of conditional logic falls away when dependent relationships can be described this way.

1 comments

this is cool, i haven't used k/q myself, this looks similar to reactive declaration in svelte.

https://svelte.dev/tutorial/reactive-declarations