Re: syntax of ^:arglists ?

2015-12-21 Thread Herwig Hochleitner
I'd say, same as you would destructure them inline: [& {:keys [k1 k2]}] -- 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

syntax of ^:arglists ?

2015-12-21 Thread Georgi Danov
Hi, Is there some formal syntax used by ^:arglists? I want to express key-value pairs that are spliced, e.g. (some-fn :k1 value :k2 value) Thanks, Georgi -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: syntax of ^:arglists ?

2015-12-21 Thread Georgi Danov
I'd like the keys to be optional and destructuring does not support that. On Mon, Dec 21, 2015, 3:48 PM Herwig Hochleitner wrote: > I'd say, same as you would destructure them inline: [& {:keys [k1 k2]}] > > -- > You received this message because you are subscribed to

Re: syntax of ^:arglists ?

2015-12-21 Thread Herwig Hochleitner
It does. When not passed, a key is nil, or you can provide an or binding: [& {:keys [k1 k2] :or {k1 :default1 k2 :default2}] -- 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

Re: syntax of ^:arglists ?

2015-12-21 Thread Herwig Hochleitner
err​ [& {:keys [k1 k2] :or {k1 :default1 k2 :default2}}] -- 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