0.0.12 permalink Arrow_down_16x16

defconfig

circumspec.config

  • (defconfig name docs default-value)
  • (defconfig name docs default-value constructor)
Define a Java config property of the form -Dcircumspec.name=...
Constructor, if specified, converts and validates from string
to the type needed.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source circumspec/config.clj:5 top

(defmacro defconfig
  "Define a Java config property of the form -Dcircumspec.name=...
   Constructor, if specified, converts and validates from string
   to the type needed."
  ([name docs default-value]
     `(defconfig ~name ~docs ~default-value identity))
  ([name docs default-value constructor]
     (assert (symbol? name))
     (assert (string? docs))
     (assert (string? default-value))
     `(defn ~name
        ~(str docs "\nDefault value is " default-value
              "\nSpecify using -Dcircumspec." name "=...")
        []
        (~constructor
         (System/getProperty ~(str "circumspec." name) ~default-value)))))
Vars in circumspec.config/defconfig: assert defmacro name str string? symbol? apply concat defn identity list seq vector
Used in 0 other vars

Comments top

No comments for defconfig. Log in to add a comment.