In C#, there s the "standard" initializer technique { Property1 = "a", Property2 = "b" }, and there are a couple of special variants for collections (list and dictionary). {value1, value2}, and { {"key1", value1 }, {"key2", value2} }.
I d like to have a recursive object initializer for a tree data type, but I don t know if there s any way to customize that mechanism. I d like something that looks like an s-expression. { item1 {item2 item3 item4 } {item5 item6} }
I m doing this via constructors, but I d like a terser syntax.