Fork me on GitHub
#clojure-spec
<
2016-10-16
>
samedhi05:10:28

> (->> (with-meta #{} {:I :am-lost}) (s/conform (s/coll-of strings?)) meta)
{:I :am-lost}
> (->> (with-meta #{} {:I :am-lost}) (s/conform (s/coll-of string?)) meta)
nil

samedhi05:10:38

I get the behavior, but I wanted to fdef check the metadata after a function call in the :fn. However, the :fn only has the conformed return values, so I don’t have the metadata. Any ideas how to do this. Or would you just say I shouldn’t include it in metadata?

Geoffrey Gaillard13:10:18

Hello everyone! I am going crazy on a cljs.spec strange behavior. I use (s/fdef) and (cljs.spec.test/instrument) in my dev mode to catch non-conform arguments. For a strange reason my spec-ed functions keep beeing called as if a generator was forever running. I have cljs.spec.test in my dependencies but I don't call it anywhere at the moment… any idea why ?

jetzajac15:10:56

Hi! How do I spec named arguments of a function/marco?

gfredericks16:10:11

jetzajac: s/keys?

gfredericks16:10:21

depends on what you meant by "named arguments" I guess

jrheard17:10:00

@ggaillard i have the same problem using cljs.spec.test/instrument! i’m glad it’s not just me

jrheard17:10:03

i can’t reproduce it reliably though

jrheard17:10:27

i really hope you’re able to figure out what’s going on and open a jira issue

jrheard17:10:32

it’s been driving me nuts

Geoffrey Gaillard17:10:07

I'm not crazy! Thank you! ^^ I can't manage to reproduce it too. I'm building a re-frame app and this situation always appear after a page refresh, when React tries to render some spec-ed Reagent components. I searched deeply into tens of stacktraces but found nothing particular 😞

jrheard17:10:03

fwiw this happens for me in http://github.com/jrheard/voke, which has very few dependencies

jrheard17:10:07

and does not include re-frame

jrheard17:10:07

but again i can’t figure out what’s going on, mainly because the behavior is inconsistent so coming up with a repro is maddening/difficult

Alex Miller (Clojure team)17:10:12

@jetzajac: oh if you mean kwargs then cat and a nested keys* for the options

jetzajac17:10:22

@alexmiller: thanx! this is what i was looking for

jrheard19:10:13

@ggaillard btw while you’re using cljs.spec.test, be wary of http://dev.clojure.org/jira/browse/CLJS-1808 and http://dev.clojure.org/jira/browse/CLJS-1812 ; fixes for both are awaiting review by @dnolen

jrheard19:10:44

(the first one's just a documentation issue)

Geoffrey Gaillard19:10:30

I struggled with the first one (ended up looking the source). Thanks a lot for the second one !