Skip to content

Instantly share code, notes, and snippets.

@mjul
Created October 24, 2011 11:40
Show Gist options
  • Select an option

  • Save mjul/1308833 to your computer and use it in GitHub Desktop.

Select an option

Save mjul/1308833 to your computer and use it in GitHub Desktop.
Clojure pattern for named parameters with defaults
;; 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