I'm trying to 'get' clojure macros and write a tweaked version of the are
macro in terms of the existing are
macro.
The tweak I want is to have signature [argv expr args]
instead of [argv expr & args]
So I've tried
(defmacro are2 [argv expr args] `(clojure.test/are ~arg ~expr ~@args))
which kind of works, except it expects an unquoted list:
(are2 [input] (= 0 input) (1 2 3))
where I'd rather it expect a quoted list:
(are2 [input] (= 0 input) '(1 2 3))
But that results in:
Unable to resolve symbol: quote in this context.
If I try
(are2 [input] (= 0 input) (list 1 2 3))
instead then list
itself gets processed as an test case.
What have I not understood / how can I get past the quote in my macro
(are2 [input] (= 0 input) (1 2 3))
? – Mikita Belahlazau