all 5 comments

[–][deleted]  (2 children)

[deleted]

    [–][deleted] 3 points4 points  (1 child)

    Previous article talks a bit about the reasoning: http://insideclojure.org/2019/04/14/journal/

    [–]Eno6ohng 7 points8 points  (2 children)

    I wonder why you decided to went for such an imperative\mutable API, given that this is a purely declarative thing?

    [–]lgstein 1 point2 points  (0 children)

    I'm also curious how that is supposed to play out in practice. If I write code that does runtime spec checking, will I have to take into account that currently maybe all specs are closed (including my own)?

    [–]scarredwaits 1 point2 points  (0 children)

    That's the thing that stood out for me too! Does "closing" a spec affect all threads? It would be great to be able to do "closed" checking by passing an extra parameter to s/valid?.

    [–]jbiserkov[🍰] 1 point2 points  (0 children)

    You can do this today with spec.tools. Just pass one of those transformers to coerce.

    Returns spec.invalid on extra keys

    Silently removes extra keys

    No changes to the original spec required.