Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created August 13, 2013 13:10
Show Gist options
  • Save frenchy64/6220921 to your computer and use it in GitHub Desktop.
Save frenchy64/6220921 to your computer and use it in GitHub Desktop.
(ann ^:no-check add-datatype-ancestors [Symbol (t/Set r/TCType) -> nil])
(defn add-datatype-ancestors
"Add a set of ancestor overrides for the datatype named sym."
[sym tset]
(assert-dt-ancestors)
(when-let-fail [a *current-dt-ancestors*]
(swap! a update-in [sym] #(set/union (or % #{}) tset)))
nil)
(defn ^:no-check ^{:ann '[Symbol (t/Set r/TCType) -> nil]}
add-datatype-ancestors
"Add a set of ancestor overrides for the datatype named sym."
[sym tset]
(assert-dt-ancestors)
(when-let-fail [a *current-dt-ancestors*]
(swap! a update-in [sym] #(set/union (or % #{}) tset)))
nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment