view demo/increment.ur @ 2257:28a541bd2d23

Use referenced (rather than all) free variables as keys for pure caches.
author Ziv Scully <ziv@mit.edu>
date Sun, 27 Sep 2015 14:46:12 -0400
parents e6bc6bbd7a32
children
line wrap: on
line source
sequence seq

fun increment () = nextval seq

fun main () =
    src <- source 0;
    return <xml><body>
      <dyn signal={n <- signal src; return <xml>{[n]}</xml>}/>
      <button value="Update" onclick={fn _ => n <- rpc (increment ()); set src n}/>
    </body></xml>