From fb64f8e726f303b58272bf354e1184045305a08a Mon Sep 17 00:00:00 2001 From: Micha Niskin Date: Tue, 24 May 2016 16:05:58 -0400 Subject: [PATCH] Add template macro to boot core -- fixes #387 --- boot/core/src/boot/core.clj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/boot/core/src/boot/core.clj b/boot/core/src/boot/core.clj index 44cfde97..c5cb9c7f 100644 --- a/boot/core/src/boot/core.clj +++ b/boot/core/src/boot/core.clj @@ -16,7 +16,8 @@ [boot.tmpdir :as tmpd] [boot.util :as util] [boot.from.io.aviso.exception :as ex] - [boot.from.clojure.tools.cli :as cli]) + [boot.from.clojure.tools.cli :as cli] + [boot.from.backtick :as bt]) (:import [boot App] [java.io File] @@ -1078,6 +1079,13 @@ ;; Task Utility Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defmacro template + "The syntax-quote (aka quasiquote) reader macro as a normal macro. Provides + the unquote ~ and unquote-splicing ~@ metacharacters for templating forms + without performing symbol resolution." + [form] + `(bt/template ~form)) + (defn gpg-decrypt "Uses gpg(1) to decrypt a file and returns its contents as a string. The :as :edn option can be passed to read the contents as an EDN form."