Parsing complex parameter lists

2016-01-18 Thread JvJ
I'm extending def macros, and I would like to know if there is an easy way 
to handle parsing the complex parameter lists that can be passed into these 
macros.

For example, defn has a parameter list something like the following:

[name doc-string? attr-map? arg-vec pre-post-map? & body]


There are so many possible conditions here.  I feel like there should be an 
easy way to do it, but my solutions so far seem too complex.

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


Re: Parsing complex parameter lists

2016-01-18 Thread James Reeves
Take a look at the name-with-attributes function in tools.macro
.

- James

On 19 January 2016 at 02:20, JvJ  wrote:

> I'm extending def macros, and I would like to know if there is an easy way
> to handle parsing the complex parameter lists that can be passed into these
> macros.
>
> For example, defn has a parameter list something like the following:
>
> [name doc-string? attr-map? arg-vec pre-post-map? & body]
>
>
> There are so many possible conditions here.  I feel like there should be
> an easy way to do it, but my solutions so far seem too complex.
>
> --
> 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.