clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
tianshu 2020-11-22T06:30:30.409200Z

Is this the expected behavior?

(s/def ::entry-as (s/tuple #{:as} symbol?))
(s/def ::entry (s/or :the-as ::entry-as))
(s/def ::map (s/coll-of ::entry :kind map?))

(s/conform ::map '{:as e});; => {:as [:as e]}
I was thought it should return something like {:the-as [:as e]} , because the branch in s/or is tagged as :the-as. spec version 0.2.187.

alexmiller 2020-11-22T07:56:10.411500Z

By default, maps are nonconforming on keys, that logic may be modifying what you expect here. You could try adding :conform-keys true to the coll spec and see if that helps

tianshu 2020-11-22T10:56:20.413800Z

Yes, set :conform-keys true will work. Thank you!

misha 2020-11-22T15:24:01.417800Z

https://akovantsev.github.io/corpus/clojure-slack/clojure-spec filterable/searchable log for this channel on a single static/offline page 1. double click on any word to filter, 2. cmd+f to highlight matches with browser's search, 3. click any date/time to show filtered out nearby lines, for context 4. recur data extracted from https://clojurians-log.clojureverse.org/clojure-spec pages

misha 2020-11-22T15:33:00.418100Z

little teaser:

misha 2020-11-22T15:33:10.418200Z

alexmiller 2020-11-22T16:56:59.419300Z

@misha can you stop spamming all the channels with this and just put one in announcements or whatever?

misha 2020-11-22T20:17:43.419600Z

sure

seancorfield 2020-11-22T20:30:46.422200Z

@misha Posting the clojure-slack level link to #news-and-articles would be fine. Not to #announcements since that is for Clojure code projects/libraries. But as Alex said, posting these links individually to channels as you add indexed versions is really annoying as we already have two existing searchable archives of nearly all channels here.

misha 2020-11-23T08:28:31.433100Z

Thank you, Sean, if I add more - I’ll announce in news channel, which I didn’t know about. I am sorry to hear 3 specific links are perceived as spam and annoying, and answering the same questions few times a week-is not. Especially after I actually tried finding things in other “searchable log”, and decided that week of dev time investment is worth it instead, and is useful to others.