1 type String 2 def bind (f : StdString -> Unit) = 3 f as_string 4 subscribe { _ s -> f s } 5 6 def to_atom = 7 let atom = Atom<StdString> as_string 8 9 subscribe { _ s -> atom.set s @[weak atom] } 10 |> atom.push_token 11 12 atom.as_readonly 13 14 def write (string : mut String) = bind { string.set _ } 15 def write (atom : mut Atom<StdString>) = bind { atom.set _ } 16