clojure-spec

cap10morgan 2024-09-12T20:50:30.508309Z

when using with-gen & fmap, is there a way to access the default generator? I want it to run and just conditionally modify its generated value. the fmap examples I've seen define entirely new generators.

Alex Miller (Clojure team) 2024-09-12T20:52:47.542349Z

you can separate the original spec (with its gen) and the one you want to use with a reference to that one with a custom gen that leverages the original

cap10morgan 2024-09-12T20:53:45.709909Z

Yeah. Was curious if there was a more self-contained approach. Sounds like no. All good though. Thanks!

nikolavojicic 2024-09-12T22:10:16.509239Z

There is this one but it is discouraged: https://clojurians.slack.com/archives/C1B1BB2Q3/p1697467463407729 (see the answers). I've used it in few places where applicable.