RFV
RFV

Reputation: 839

What does ^{ mean?

In the following code, I have noticed the ^ character before what seems to be a map data structure. What is ^ used for, or what is ^{ 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))

Upvotes: 2

Views: 112

Answers (1)

Chris Murphy
Chris Murphy

Reputation: 6509

The ^ character is for metadata. Please see https://clojure.org/reference/reader#macrochars and https://clojure.org/reference/metadata.

^{:on-reload :noop} and (with-meta obj {:on-reload :noop}) are equivalent.

Upvotes: 3

Related Questions