Skip to content

Instantly share code, notes, and snippets.

@tolitius
Created January 22, 2015 03:39
Show Gist options
  • Save tolitius/695e78e4e38a0400df21 to your computer and use it in GitHub Desktop.
Save tolitius/695e78e4e38a0400df21 to your computer and use it in GitHub Desktop.
testing for two error codes with types
=> (def error-codes [[:code "ERROR" :type "title"] [:code "ERROR" :type "id"]])
=> error-codes
[[:code "ERROR" :type "title"] [:code "ERROR" :type "id"]]
=> (let [[[_ c1 _ t1] [_ c2 _ t2]] error-codes] [(distinct [c1 c2]) #{t1 t2}])
[("ERROR") #{"id" "title"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment