Created
October 24, 2011 11:40
-
-
Save mjul/1308833 to your computer and use it in GitHub Desktop.
Clojure pattern for named parameters with defaults
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; From Incanter Charts - neat way to do named parameters with defaults in Clojure: | |
| ([chart & options] | |
| (let [{:keys [width dash series dataset] | |
| :or {width 1.0 dash 1.0 series 0 dataset 0}} (apply hash-map options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment