Does anybody have a few examples of DSLs people make in a lisp (ideally clojure because I have worked with it a tad)? I've seen plenty of cases where people make a pseudo-dsl via optional arguments, but not seen this so-oft mentioned "yeah we just wrote a dsl for it because lisp" sort of deal.
For example, write the third field of every record (if the field exists) into `file.{recnum}`:
(awk ([f 2] (-> `file.@nr` (prn [f 2]))))
The manual contains a translation of all of the Awk examples from the POSIX standard:http://www.nongnu.org/txr/txr-manpage.html#N-03D16283
The (-> name form ...) syntax above is scoped to the surrounding awk macro. Like in Awk, the redirection is identified by string. If multiple such expressions appear with the same name, they denote the same stream (within the lexical scope of the awk macro instance to which they belong). These are implicitly kept in a hash table. When the macro terminates (normally or via non-local jump like an exception), these streams are all closed.