Re: Aw: defnk pre- and post-conditions

2011-04-26 Thread Ambrose Bonnaire-Sergeant
On Tue, Apr 26, 2011 at 8:26 PM, Hugo Duncan wrote: > > Inspired by a discussion [1] on supporting shFlags in stevedore, I drafted > a defnkw [2] that allows for the following syntax: > > (defnkw foo > "My foo" > [positional1 … positionalN >& [[kw1 description1 default1] > [kw2 descrip

Re: Aw: defnk pre- and post-conditions

2011-04-26 Thread Hugo Duncan
On Tue, 26 Apr 2011 07:27:52 -0400, Meikel Brandmeyer wrote: clojure supports keyword arguments for a quote some time now. (defn foo [positional1 ... positionalN & {:keys [kw1 ... kwn]}] ...) This is used extensively in Pallet but has a couple of drawbacks. - Repetition of keywords to

Aw: defnk pre- and post-conditions

2011-04-26 Thread Meikel Brandmeyer
Hi, clojure supports keyword arguments for a quote some time now. (defn foo [positional1 ... positionalN & {:keys [kw1 ... kwn]}] ...) The syntax is the usual destructuring syntax for maps. So you can specify defaults via :or etc. And even have none keyword keys. Sincerely Meikel -- You