Skip to content

Instantly share code, notes, and snippets.

@doublec
Created December 5, 2011 03:34
Show Gist options
  • Save doublec/1432185 to your computer and use it in GitHub Desktop.
Save doublec/1432185 to your computer and use it in GitHub Desktop.
fun foo {v:view} (pf: !v | b1: (!v | int) -<cloref> void):void = {
val v = 5
val () = b1(pf | v)
}
implement main () = {
var x: int? with pf_x
viewdef V = int? @ x
val () = foo {V} (pf_x | lam (pf | newval) => x := newval)
val () = printf("%d\n", @(x))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment