clojure specs for maps and their values
<p>I'm using Clojure to implement a (written) standards document. In general I'm pleased with the way Clojure allows me to write code that lines up with the different parts of the standard. With an eye on the future I am experimenting with writing a <code>clojure.spec</code> for it. In the document they define various structured data elements with named fields. However fields in different structures have the same name, for example the 'red' structure has a 'value' field which is a string, but the 'blue' structure has a 'value' field which is an integer. How can I handle this when it comes to writing specs?</p>

<pre><code>(s/def ::value ???)
(s/def ::red (s/keys :req [::value ...]))
(s/def ::blue (s/keys :req [::value ...]))
</code></pre>

<p>The <a href="http://clojure.org/about/spec#_map_specs_should_be_of_keysets_only" rel="nofollow noreferrer">official advice</a>, as I understand it, is that named keys should have the same semantics everywhere.</p>

<p>How should I approach this? I could call them 'red-value' and 'blue-value' but this makes the correspondence between the code and the standard less clear. Could I put every structure in its own namespace?</p>