[ANN] Clojure Programming Cookbook

2016-11-17 Thread Gary Deer
Congrats! I bought this monster and my Kindle reader said it was going to take 10 minutes just to read the table of contents =) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that po

Re: Validate different maps that have the same keys in the same namespace

2016-11-17 Thread Francis Avila
Your spec names need different namespaces, but your functions do not: (s/def :catalog-a/type #{"a" "b" "c"}) (s/def :catalog-a/ref string?) (s/def :catalog-b/type #{:x :y :z}) (s/def :catalog-b/ref number?) Then you need to say that the keys are unqualified when they appear in the map for thi

Re: Validate different maps that have the same keys in the same namespace

2016-11-17 Thread Alex Miller
(s/def :a/type #{"a" "b" "c"}) (s/def :a/ref string?) (s/fdef get-product-from-catalog-a :args (s/keys :req-un [:a/type :a/ref]) :ret any?) ;; --- (s/def :b/type #{:x :y :z}) (s/def :b/ref number?) (s/fdef get-product-from-catalog-b :args (s/keys :req-un [:b/type :b/ref]) :ret any?)

Re: Validate different maps that have the same keys in the same namespace

2016-11-17 Thread damien . ragoucy
I forgot the :req-un. (s/fdef get-product-from-catalog-[a|b] :args (s/keys :req-un [::type ::ref]) :ret any?) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Validate different maps that have the same keys in the same namespace

2016-11-17 Thread damien . ragoucy
Hello, I started a new project with clojure.spec after a former project where I used Prismatic schema. There is one thing I really don't get: how can I define two specs for maps with the same keys but not the same "types" in the same namespace? Let's consider this example written with schema s

[ANN] Skyscraper 0.2.3

2016-11-17 Thread Daniel Janus
Dear Clojurians, Skyscraper 0.2.3, an Enlive-based library for scraping information from whole sites in a structural way, has been released. Homepage / GitHub: https://github.com/nathell/skyscraper Clojars: https://clojars.org/skyscraper New in this release: - New feature: Custom parse fu