May 2018
Beginner to intermediate
290 pages
6h 43m
English
The best way to get a feeling for records and protocols is to see them in action in real code.
For that let’s return to the Clostache templating library, which you will recall takes most of the pain out of the substitute this value in the HTML task that virtually all web applications need to perform. To make Clostache work you need a template string and a map of values:
| | (require 'clostache.parser) |
| | |
| | (def template "The book {{title}} is by {{author}}") |
| | |
| | (def values {:title "War and Peace" :author "Tolstoy"}) |
And you can use the Clostache render function to populate the template with your values:
| | ;; Gives you "The book War and Peace is by Tolstoy" |
| | |
| | (clostache.parser/render template values) |
One of the more powerful ...
Read now
Unlock full access