Fork me on GitHub

what are the main differences between spec 2 and alpha?


mainly how they handle aggregates of attributes. You only specify required/optional attributes at the context of the usage site

👍 8

‘bags’ of attributes are now the primary way of mapping domain entities in spec2, they don’t talk about requirements


also some programmatic convenience improvements


of course I am oversimplifying


hello, with spec1, I'm having issues to define a spec that is not loaded, I get Unable to resolve spec: ..., consider this is file B, the spec in question is defined by A, but A requires B, so I can't load A before loading B (circular reference), with that constraint, is there a way to tell spec to ignore that the spec is not defined at that time?

Alex Miller (Clojure team)16:11:37

most spec types delay resolving references so don't run into this, but there are a few that don't

Alex Miller (Clojure team)16:11:58

for those that don't, you'll need to break that cycle somehow


thanks, I got rid of the cycle by moving those spec definitions to a new namespace (since I we can define things from other namespaces, so still have the same name, just defined in a different file)


What's the best way to restrict a string to a min/max length, so that the generator still works for it ?

Alex Miller (Clojure team)21:11:58

I don't think there is a general way to do that without writing a generator

Alex Miller (Clojure team)21:11:20

(and to do that, I would generate strings of length up to (max-min) and a string of length min, then concat)


Hum, alright, I'll use a custom generator then