3 ms·
Your JSON snippet is reminiscent of SXML, a format for describing XML/HTML as s-expressions. The difference being that, using quasiquote and unquote, Lisps are
by davexunit 12y ago
Your JSON snippet is reminiscent of SXML, a format for describing XML/HTML as s-expressions. The difference being that, using quasiquote and unquote, Lisps are full-fledged templating languages.
Here's a simple template written in Scheme:
(define stuff '("foo" "bar" "baz"))
`(ul (@ (class "foo"))
,@(map (lambda (thing)
`(li ,thing))
stuff))
Output:
(ul (@ (class "foo")) (li "foo") (li "bar") (li "baz"))
Fun stuff!