3 ms·
I don't get the article: if you want to copy sexps in JSON why don't you just use JSON lists mapping simbols to strings? e.g. (p "Paragraph text here, " (b
by riffraff 15y ago
I don't get the article: if you want to copy sexps in JSON why don't you just use JSON lists mapping simbols to strings?
e.g.
(p "Paragraph text here, " (b "bold text"))
becomes
['p','paragraph text here, ',['b','bold text']]
where space become commas, and '()' become '[]'.
The json example form html formatting is willingly verbose without reason to be.
- twfarland 15y agoYeah - I make my templates in much the style you describe, and render them with https://github.com/twfarland/don https://github.com/twfarland/don.
- hakanensari 15y agoThe author's json example could have been something like: { 'p': ['Paragraph text here', { 'b': 'bold text' }] } Still more verbose than the sexp example but not terribly so.
- anon_d 15y ago(or (= 0 (+ x y)) (print "hi")) ['or', ['=', 0, ['+', 'x', 'y']], ['print', 'hi']]