O'Reilly logo

Clojure Recipes by Julian Gamble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11. Simplifying Datomic Syntax by Writing a DSL

The context here is that creating schema and writing inserts for Datomic are unnecessarily verbose, especially for people who think in Clojure. The idea is to take advantage of this “expressiveness gap” and use Clojure to write a DSL to make writing Datomic schema and inserts less verbose. We’ll reduce and map over Clojure maps to generate the Datomic syntax for schema creation and adding datoms. Instead of using the Datomic shell, we’ll use an in-memory version of Datomic that we access from Clojure.

Assumptions

In this chapter we assume the following:

Image You have Leiningen installed.

Using the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required