clojure - What does ^{ mean? -
in following code, have noticed ^
character before seems map data structure. ^
used for, or ^{
used for?
(ns temper.core (:gen-class) (:require [mount.core :as mount])) (mount/defstate ^{:on-reload :noop} http-server :start (http/start (-> env (assoc :handler (lazy-run 'temper.handler 'app)) (update :port #(or (-> env :options :port) %)))) :stop (http/stop http-server))
the ^
character metadata. please see https://clojure.org/reference/reader#macrochars , https://clojure.org/reference/metadata.
^{:on-reload :noop}
, (with-meta obj {:on-reload :noop})
equivalent.
Comments
Post a Comment