concept domain in category clojure

appears as: domain, domain, The domain, domains
The Joy of Clojure, Second Edition

This is an excerpt from Manning's book The Joy of Clojure, Second Edition.

Separating the plumbing from the domain
Listing 16.10. A core.logic Sudoku solver
(defn solve-logically [board]   (let [legal-nums (fd/interval 1 9) #1         lvars (logic-board)                    rows  (rowify lvars) #2         cols  (colify rows)         grids (subgrid rows)]              (logic/run 1 [q]       (init lvars board) #3       (logic/everyg #(fd/in % legal-nums) lvars) #4       (logic/everyg fd/distinct rows) #5       (logic/everyg fd/distinct cols)       (logic/everyg fd/distinct grids)       (logic/== q lvars)))) #1 – 1 Set the domain #2 – 2 Set up views #3 – 3 Propagate bindings #4 – 4 Check each lvar #5 – 5 Check each view for distinctness !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[]"} !@%STYLE%@!

In chapter 8, we explored the notion of a domain-specific language for describing domains with the man-versus-monster example, and the domain macro in particular. This meta-circularity, although playful, was meant to make a subtle point: Clojure blurs, and often obliterates, the line between DSL and API. When a language is built from the same data structures that the language itself manipulates, it’s known as homoiconic (Mooers 1965). When a programming language is homoiconic, it’s simple to mold the language into a form that bridges the gap between the problem and solution domains. We hinted at this point in chapter 14 during the discussion of the defunits-of macro; the best language for solving a problem is the language of the domain itself. But with DSLs, a caveat always applies: