setting => property-name value
Sets the system properties to the supplied values, executes the body, and
sets the properties back to their original values. Values of nil are
translated to a clearing of the property.
(defmacro with-system-properties
"setting => property-name value
Sets the system properties to the supplied values, executes the body, and
sets the properties back to their original values. Values of nil are
translated to a clearing of the property."
[settings & body]
`(let [settings# ~settings
current# (reduce (fn [coll# k#]
(assoc coll# k# (get-system-property k#)))
{}
(keys settings#))]
(set-system-properties settings#)
(try
~@body
(finally
(set-system-properties current#)))))
Comments top
No comments for with-system-properties. Log in to add a comment.