Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding extra predicates 100 tries error. #20

Open
ghost opened this issue Jan 25, 2023 · 1 comment
Open

Adding extra predicates 100 tries error. #20

ghost opened this issue Jan 25, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 25, 2023

I'm not really sure if it's worth the trouble to do something about this, but I thought I'd report it since it is somewhat normal usage. I've worked around it by writing the spec less generically and using more of them, but I've got a spec described as;

(s/def :dp.attr/dt-kw (s/and :dp.attr/keyword #(kw-in-ns-hierarchy? % "dp.dt")))

Where the predicate function is,

(defn kw-in-ns-hierarchy? "Takes a keyword and a partial or complete namespace and responds true if the keyword is in the hierarchy." [kw, ns-partial-string] (clojure.string/starts-with? (namespace kw) ns-partial-string))

Meaning the keyword could be anything that starts with :dp.dt. This blows up the generation stage.

=> Execution error (ExceptionInfo) at provisdom.spectomic.core/find-type-via-generation$fn (core.clj:79). Couldn't satisfy such-that predicate after 100 tries.

This may be a hard limitation, no biggie over here. Just thought you should know. I'm enjoying having the library in my workflow. Thanks for sharing!

@ghost
Copy link
Author

ghost commented Jan 26, 2023

Well, chalk another one up to the folks at Cognitect. This was no problem after RTFM and using a with-gen. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants