This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-30
Channels
- # 100-days-of-code (2)
- # announcements (2)
- # beginners (8)
- # boot (6)
- # calva (52)
- # cider (6)
- # cljs-dev (11)
- # cljsrn (3)
- # clojure (58)
- # clojure-austin (2)
- # clojure-russia (6)
- # clojure-spec (23)
- # clojure-uk (12)
- # clojurescript (29)
- # datomic (10)
- # emacs (1)
- # figwheel (2)
- # figwheel-main (2)
- # fulcro (3)
- # luminus (1)
- # off-topic (38)
- # re-frame (21)
- # ring-swagger (1)
- # robots (1)
- # shadow-cljs (65)
- # spacemacs (3)
- # tools-deps (16)
@bbrinck how is it even reproducible in case 4? https://gist.github.com/bhb/462c3ef97058d669a448aa85e7db5998#file-ex-txt-L47
@misha I may be misunderstanding your question, but the order of a map is consistent, (i.e. for the same map m
, (first m)
will always return the same thing, since maps are seqable?
).
Is the only difference between using spec/valid?
in the pre/post map of a function and spec/fdef
that spec/fdef
can be specified elsewhere?
you have to instrument
fdef
’d functions, and that won’t check the function return value like :post
does
I'm noticing that instrument-all
is no longer available. Is it common to just instrument a single function while testing it nowadays?
Oh, nice 🙂
fdef
doesn't verify the output from the :ret
parameter though?
At least while using instrument
?
Huh, is there anything that actually uses the :ret
then?
there’s a lib called Orchestra with another version of instrument
that adds return value checking
:thumbsup:
Thanks
Ah, ok
I wrote some examples here too https://blog.taylorwood.io/2017/10/15/fspec.html
@bbrinck I do not know your use case exactly, but as long as you are only relying on that for the same identical map m
, not two different maps m1
and m2
where (= m1 m2)
. If you try to rely on (= (first m1) (first m2))
you will often be disappointed. But yes, you can rely on (= (seq m) (seq m))
being true.
@andy.fingerhut good point! Yes, this is for the identical map - the “in” path returned by spec is only valid for the data you originally check, NOT other data that happens to be equal to the original data.