Permalink
Browse files

Merge pull request #11 from frenchy64/remove-default

Removed default argument from defconstrainedtype
  • Loading branch information...
2 parents 4f3afc2 + cb25018 commit 10bf2c4f12d4fab9c0b53188450b0c05334c52f8 @fogus fogus committed Nov 30, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/trammel/core.clj
@@ -271,8 +271,7 @@
(defmacro defconstrainedtype
[name slots invariants & etc]
- (let [fields (->> slots (partition 2) (map first) vec)
- defaults (->> slots (partition 2) (map second))
+ (let [fields (vec slots)
ctor-name (symbol (str name \.))
factory-name (symbol (str "new-" name))]
`(do
@@ -284,7 +283,6 @@
~(str "Invariant contract for " name)
[{:keys ~fields :as m#}] ~invariants)]
(defconstrainedfn ~factory-name
- ([] [] (~ctor-name ~@defaults))
(~fields ~invariants
(~ctor-name ~@fields))))
~name)))

0 comments on commit 10bf2c4

Please sign in to comment.