Skip to content
Browse files

and now invariant records are (mostly) in place.

  • Loading branch information...
1 parent 2c262e7 commit f021de64163960bfa3b872a81811225332c6dd24 @fogus committed
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/fogus/me/trammel.clj
16 src/fogus/me/trammel.clj
@@ -268,17 +268,23 @@
((partial contract identity) (apply f m args))
(apply f m args))))
+(alter-var-root (var assoc) apply-contract)
+(alter-var-root (var dissoc) apply-contract)
+(alter-var-root (var merge) apply-contract)
+(alter-var-root (var merge) apply-contract)
+(alter-var-root (var merge-with) (fn [f] (fn [f & maps] (apply (apply-contract merge-with) f maps))))
+(alter-var-root (var into) apply-contract)
+(alter-var-root (var conj) apply-contract)
+(alter-var-root (var assoc-in) apply-contract)
+(alter-var-root (var update-in) apply-contract)
(defconstrainedrecord Foo [a 1 b 2]
[(every? number? [a b])]
(toString [this] (str "record Foo has " a " and " b)))
- (def a (wrap assoc))
- (a (new-Foo) :a 33 :b 45 :c 88)
+ (str (new-Foo :a 77))

0 comments on commit f021de6

Please sign in to comment.
Something went wrong with that request. Please try again.