On Friday, June 17, 2016 at 4:04:31 PM UTC-4, Alex Miller wrote:
>
>
>
> On Friday, June 17, 2016 at 2:46:37 PM UTC-5, Brian Platz wrote:
>>
>>
>> I'd like to be able to use clojure.spec for input validation where the 
>> specs are stored in a database using a data structure to represent them.
>>
>
> Why don't you represent them as code loaded by different applications? 
> s/form is designed to give you a wire-portable definition of a spec.
>

Nice feature, thank you for pointing it out.
 

>  
>
>> The following ideas could make this much simpler:
>> - Allow s/keys to accept a spec to use with each key (i.e. the same 
>> format used by s/or).
>>
>
> The independence of attribute specs is a fundamental tenet of spec and 
> this will not be changed.
>

The use of the registry and independence of it I think is great, and the 
two need not confict. I'd primarily use the registry for my applications, 
but testing inputs dynamically lacks support around maps with the exception 
of map-of. 

Right now the only reasonable solution I see is to write my own s/keys-like 
predicate. The request was to allow maps to be tested with a generated spec 
in the same way every other Clojure data structure can be (sans-registry) 
as it seems missing, but not challenge the registry concept and its value.
 

>  
>
>> - Allow a *spec-registry* binding, enabling the use of multiple registries
>>
>
> The notion of multiple registries is something that's been raised, but 
> Rich will have to be the one to comment on that.
>

This could also solve my particular use-case, and I'm sure has some other 
uses.

Thank you for the response.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to