             [the-name constructor predicate the-keys]
             (let [ns-key (ns-keyword the-name)
                   ks (mapv ns-keyword the-keys)]
-              `(~(s-def) ~ns-key
-                (~(s-spec) (~(s-and) ~predicate (~(s-keys) :req-un ~ks))
+              `(s-def ~ns-key
+                (s-spec (s-and ~predicate (s-keys :req-un ~ks))
                  :gen (fn []
-                        (->> (~(s-gen) (~(s-keys) :req-un ~ks))
-                             (~(s-fmap) (fn [ks#] (apply ~constructor
-                                                        (vals ks#))))))))))
+                        (->> (s-gen (s-keys :req-un ~ks))
+                             (s-fmap (fn [ks#] (apply ~constructor
+                                                      (vals ks#))))))))))
           (define-constructor-spec-form
             [the-name the-ret-type the-args-list the-specs-list]
             (let [key-args-list (map keyword the-args-list)
                   ns-spec-list (map ns-keyword the-specs-list)
                   the-args-entry (apply concat (map (fn [l r] [l r]) key-args-list ns-spec-list))]
-              `(~(s-fdef) ~the-name
-                :args (~(s-cat) ~@the-args-entry)
+              `(s-fdef ~the-name
+                :args (s-cat ~@the-args-entry)
                 :ret ~(ns-keyword the-ret-type))))
           (define-accessor-spec-form
             [the-accessor-name the-type-name]
-            `(~(s-fdef) ~the-accessor-name
-              :args (~(s-cat) ~(keyword the-type-name) ~(ns-keyword the-type-name))
+            `(s-fdef ~the-accessor-name
+              :args (s-cat ~(keyword the-type-name) ~(ns-keyword the-type-name))
               :res boolean?))
           (define-spec-form
             [the-name the-predicate]
             (let [ns-key (ns-keyword the-name)]
-              `(~(s-def) ~ns-key ~the-predicate)))]
+              `(s-def ~ns-key ~the-predicate)))]
     (let [?field-triples (field-triples ?field-specs &form)
           ?constructor (first ?constructor-call)
           ?constructor-args (rest ?constructor-call)

    [(:require
      [active.clojure.condition :as c]
      [clojure.spec.alpha :as s]
      [clojure.spec.gen.alpha :as gen])]
    :cljs
    [(:require
      [active.clojure.condition :as c]
      [cljs.spec.alpha :as s]
      [cljs.spec.gen.alpha :as gen])]))

(def pass (constantly true))

(defn throw-illegal-argument-exception
  [msg]
  (c/assertion-violation `throw-illegal-argument-exception "Illegal argument" msg)
  #_(throw
   #?(:clj  (IllegalArgumentException. msg)
      :cljs (js/Error. msg))))

;; Only needed in ClojureScript, does nothing in Clojure
(defn check-type

           :args (s/cat ~(keyword the-type-name) ~(ns-keyword the-type-name))
           :res ~boolean?))

(defmacro s-def
  [& args]
  `(if-cljs (cljs.spec.alpha/def ~@args)
            (clojure.spec.alpha/def ~@args)))

(defmacro s-fdef
  [& args]
  `(if-cljs (cljs.spec.alpha/fdef ~@args)
            (clojure.spec.alpha/fdef ~@args)))

(defmacro s-and
  [& args]
  `(if-cljs (cljs.spec.alpha/and ~@args)
            (clojure.spec.alpha/and ~@args)))

(defmacro s-cat
  [& args]
  `(if-cljs (cljs.spec.alpha/cat ~@args)
            (clojure.spec.alpha/cat ~@args)))

(defmacro s-spec
  [& args]
  `(if-cljs (cljs.spec.alpha/spec ~@args)
            (clojure.spec.alpha/spec ~@args)))

(defmacro s-keys
  [& args]
  `(if-cljs (cljs.spec.alpha/keys ~@args)
            (clojure.spec.alpha/keys ~@args)))

(defmacro s-gen
  [& args]
  `(if-cljs (cljs.spec.alpha/gen ~@args)
            (clojure.spec.alpha/gen ~@args)))

(defmacro s-fmap
  [& args]
  `(if-cljs (cljs.spec.gen.alpha/fmap ~@args)
            (clojure.spec.gen.alpha/fmap ~@args)))

#?(:clj
(defmacro define-record-type
