I think there's the spec is a 'side-band' system (well except we want to
the compiler to know about it for macros) design constraint, but
additionally, I think it's worth thinking about:

Defn right now is primitive enough to be fast and powerful enough for large
programs.  There are many general and competing things a developer might
want to be available in a more powerful or opinionated defn, but I think
we'd agree the benefit of what you propose scales as a convention across a
larger codebase and so do other general defn wrappers.  I can think of a
few other examples like this, how about plumatic's defnk graph function
macro?  How about core.match pattern-matching with the 'defun' project?
How about the schema s/defn?  How would someone combine them when macros
generally don't compose too well?

I think that sort of thing should be possible, but too opinionated for how
'core' clojure.spec is intended to be.  Decisions like that are for
application architectures.

On Tue, Sep 19, 2017 at 5:29 PM Didier <didi...@gmail.com> wrote:

> I've been thinking since using Clojure.spec fdef that I'd like something
> like this:
>
> (defns foo
>   [x string? y int?] string?
>    forms)
>
> Where an s/fdef spec automatically build of this form:
>
> (s/fdef foo
>   :args (s/cat :x string? :y int?)
>   :ret string?))
>
>
> And obviously the foo var and function would also be created.
>
> I feel like the core team didn't choose this route though, and so I'm
> curious why, and if its actually a bad idea?
>
> --
> 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.
>

-- 
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