3 ms·
It's not uncommon. An example in Racket is html-template.[0] Hiccup is one in Clojure.[1] There's a spectrum of methods for doing things like this: both Clojure
by grzm 9y ago
It's not uncommon. An example in Racket is html-template.[0] Hiccup is one in Clojure.[1] There's a spectrum of methods for doing things like this: both Clojure and Racket have Mustache[2] implementations.
"Confusing and hard to grok"† is in the eye of the beholder. Syntax highlighting and indentation go a long way (as well as exposure), though even in black and white, the parens fade for me much more than angle brackets do. Personally, I'd wrap some of the longer lines, but that's a style thing.
[0]: https://docs.racket-lang.org/html-template/index.html https://docs.racket-lang.org/html-template/index.html.
[1]: https://github.com/weavejester/hiccup https://github.com/weavejester/hiccup
[2]: https://mustache.github.io/mustache.5.html https://mustache.github.io/mustache.5.html
† Sorry. Couldn't let the typo stand. Heinlein made me do it.
- spapas82 9y agoClojure also has Selmer (https://github.com/yogthos/Selmer https://github.com/yogthos/Selmer) which is a Django inspired templating language!