Fork me on GitHub
#clojure-spec
<
2017-02-24
>
Oliver George00:02:58

@alexmiller Thanks Alex, that's helpful. Sounds like some of those issues could be addressed with a LRU/TTL version of memoize. Shame CLJS doesn't have one packed up at this point.

Oliver George00:02:20

(or flushing the memo cache when the spec registry changes)(

Alex Miller (Clojure team)00:02:42

Yeah, core.cache and core.memoize have those, but not cljs right now

Alex Miller (Clojure team)00:02:22

@ag there is a pending patch to fix keys gen for opts

ag01:02:19

if my vector contains maps with a key that’s value is a function, how do I check for it? is there a predicate like function?. Actually what I have there is a clojurescript function. (type) returns something like this: #object[Function "function Function() { [native code] }”] how can I get a predicate that checks for that?

bnoguchi01:02:07

If we don't want specs' conformed values to thread in an (s/and spec-1 spec-2 from spec-1 to spec-2 to etc , can we substitute s/merge for s/and? And can spec-* be a non-map spec or just a predicate when called with merge?

danielcompton01:02:22

@ag: cljs.core/ifn?

ag01:02:17

@danielcompton something tells me that this is right, but for some reason not really working when placed into .cljc file (s/map-of keyword? ifn?)

ag01:02:41

oh, I think my problem not that, spec works, but needs a generator. hold on

ag01:02:08

Unable to construct gen at: [:options 1] for: ifn?]

ag01:02:11

this worked:

(s/with-gen (s/map-of keyword? ifn?)
                         #(gen/return {:on-click (fn [e] nil)}))

danielcompton01:02:23

Oh, maybe cljs.core/fn? would be more appropriate, as maps, keywords, e.t.c. are also ifn?

ag02:02:28

an hour ago I didn’t know that either of them existed. ¯\(ツ)

ag02:02:22

yup, you’re right! Thank you @danielcompton

j-po21:02:48

Should (require '[my-ns :as n]) allow you to then address :my-ns/kw as :n/kw? I'd been functioning under the impression that yes, but now I'm trying to address a spec defined in another file in the repl and I'm getting "unable to resolve spec".

Alex Miller (Clojure team)21:02:10

The :: means "auto-resolve" which will use aliases