Skip to content

Instantly share code, notes, and snippets.

@wfaler
Created April 13, 2013 18:51
Show Gist options
  • Select an option

  • Save wfaler/5379600 to your computer and use it in GitHub Desktop.

Select an option

Save wfaler/5379600 to your computer and use it in GitHub Desktop.
defdata example
(defdata MyDataType [name age]
{:name non-empty-string? :age number?} ;; map with validation functions for each key in a concrete instance
SomeProtocol ;; optional protocol/interface implementations
(some-protocol-fn-impl [a] (println a)) ;; implementation of protocol functions
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment