2 ms·
I would call "Comma-Separated Trees" a subtype of Tree Notation (https://github.com/breck7/jtree https://github.com/breck7/jtree). The first time this style of
by breck 8y ago
I would call "Comma-Separated Trees" a subtype of Tree Notation (https://github.com/breck7/jtree https://github.com/breck7/jtree). The first time this style of notation appeared was in Egil Möller's SRFI from 2005 (https://srfi.schemers.org/srfi-49/srfi-49.html https://srfi.schemers.org/srfi-49/srfi-49.html).
I really enjoy this style of format. It makes reading and writing structured data a breeze, and can handle any format with no escaping save indentation. You can embed csvs,tsvs,psvs, et cetera, right in the tree, like in these Comma-Separated Trees. You can write a grammar file to ensure strong type checking. Finally, you can easily do conversions "fromCsv/toCsv, fromJson/toJson, fromXml/toXml, fromSql/toSql" et cetera...
Here's another example showing an embedded PSV (and also same type later expressed as a tree) and some source code embedded showing how you don't need escaping.
cobol
books
title|year|author|id|rating|ratings|reviews
Cobol Programming|1983|M.K. Roy|4944251|4.11|9|1
Structured Cobol Programming|1979|Nancy B. Stern|9030220|4.33|15|0
fileType text
year 1960
lua
fileType text
books
book
title Programming in Lua
year 2001
author Roberto Ierusalimschy
id 1321894
rating 3.97
example
function factorial(n)
local x = 1
for i = 2, n do
x = x * i
end
return x
end