Assuming the . is for any unnamed component (and thus will be repeated in the list) that strikes me as a particularly bad encoding. If you take the perspective of using generic tool to process s-expressions then neither can you query this as a dictionary (assuming you have the right encoding…) nor directly as a list (tuple). The best of both worlds!
That |2| should rather read "1". I personally much prefer this encoding because:
- It avoids dealing with heterogenous arrays (e.g. in
jsontthey entail decoding to a generic representation because it optimizes for uniform arrays). - It allows user friendly (named) queries.
But then this assumes you are interested in querying your serializations with generic JSON tools.