Created
April 13, 2013 18:51
-
-
Save wfaler/5379600 to your computer and use it in GitHub Desktop.
defdata example
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
| (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