On Sep 8, 2012, at 9:28 AM, Steven E. Harris wrote: > Michael Fogus <mefo...@gmail.com> writes: > >> Data formats do not exist in a vacuum. They are parsed by languages. >> Some may have a fine-grained distinction between lists, arrays/vectors >> and sets and some may not. > > The concern I have is for someone wanting to define a format atop EDN -- > or, to put it differently, to define a schema for it. If we want to > define a structure to be represented in EDN such as a list of a person's > favorite colors, on what basis would the schema author choose between > list and vector notation? Is there a higher-level abstract type that he > specify and require that a conforming processor accept either a list or > vector literal?
Yes, sequence, which includes lists and vectors. I would expect most applications should be written to not care unless/until it mattered to them, and otherwise be permissive in what they accept. I can add language to suggest that. > > Even if he could mandate that, say, the favorite color list is of type > "sequence" -- listed in descending order of preference -- then an author > creating the EDN to represent such a person again has to make a choice > between a list and a vector, again without a clear basis for his > decision. > There's no crisis in that. One of () or [] will be more familiar. > As an appeal to prior art, Rivest's "S-Expressions" Internet-Draft¹ used > only a single list structure, though it does define three different > encodings for that structure. > I don't think a data format that has only parenthesized lists has a chance for success. I think one without would be a crime against DSL authors. I had this argument with myself when work on Clojure began, and I think its accepting both was a factor in its success. Rich -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en