Hi,

I already asked this in the spec channel on slack, but got no response yet.

I have this simple spec definition:

(s/def ::foo string?)

​

(s/def ::column (s/keys :req-un [::foo]))

​

(s/def ::columns (s/cat :col (s/* (s/spec ::column))))

;(s/def ::columns (s/cat :col (s/* ::column)))

​

(defn remove-autoinc-columns [cols]

  (vec (remove #(= true (:autoinc %)) cols)))

​

(s/fdef remove-autoinc-columns :args (s/cat :cols ::columns)

        :ret ::columns)

​


$(remove-autoinc-columns [{:foo "some_t"}])

===> ExceptionInfo Call to #'de.sveri.clospcrud.s-play/remove-autoinc-columns 
did not conform to spec:

At: [:args] val: ([{:foo "some_t"}]) fails predicate: (cat :cols 
:de.sveri.clospcrud.s-play/columns),  Extra input

:clojure.spec/args  ([{:foo "some_t"}])

  clojure.core/ex-info (core.clj:4617)


On the other hand, running this:
(s/conform ::columns [{:foo "some_t"}])
=> {:col [{:foo "some_t"}]}
works.

So something is broken within the fdefs argument definition.

I dont see my mistake here, can somone else reproduce / fix this?

Thanks,
Sven

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to