Skip to content

Commit fb64f8e

Browse files
committed
Add template macro to boot core -- fixes #387
1 parent 9712c7f commit fb64f8e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

boot/core/src/boot/core.clj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
[boot.tmpdir :as tmpd]
1717
[boot.util :as util]
1818
[boot.from.io.aviso.exception :as ex]
19-
[boot.from.clojure.tools.cli :as cli])
19+
[boot.from.clojure.tools.cli :as cli]
20+
[boot.from.backtick :as bt])
2021
(:import
2122
[boot App]
2223
[java.io File]
@@ -1078,6 +1079,13 @@
10781079

10791080
;; Task Utility Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10801081

1082+
(defmacro template
1083+
"The syntax-quote (aka quasiquote) reader macro as a normal macro. Provides
1084+
the unquote ~ and unquote-splicing ~@ metacharacters for templating forms
1085+
without performing symbol resolution."
1086+
[form]
1087+
`(bt/template ~form))
1088+
10811089
(defn gpg-decrypt
10821090
"Uses gpg(1) to decrypt a file and returns its contents as a string. The
10831091
:as :edn option can be passed to read the contents as an EDN form."

0 commit comments

Comments
 (0)