///| Spike: session state as EDN (see the plan to persist compositor state across a component swap). ///| A toy snapshot with the shapes we need: ints, strings, nested maps/vectors, keywords. pub fn sample() -> String { "{:version 1 :server {:next-client 4 :next-serial 412 :selection [2 17]} :clients [{:id 2 :fd 11 :toplevels {5 {:title \"foot\" :min [0 0]}}}]}" } ///| Read, change one field by path, write back. pub fn bump_serial(text : String) -> String raise { let v = @edn.read(text) let next = @edn.transact(v, [ @edn.Replace( [@edn.Key(@edn.Keyword("server")), @edn.Key(@edn.Keyword("next-serial"))], @edn.Integer("500"), ), ]) @edn.write(next) }