Re: Newbie: Default map parameters

2008-11-17 Thread Mark McGranaghan
Mark, You can read some about destructuring in the documentation for the special form "let": http://clojure.org/special_forms#let You can also explore the functionality at the repl: user=> (destructure '[{x :x, y :y, :or {y 3}} given]) [map__59 given y (clojure.core/get map__59 :y 3) x (clojure

Re: Newbie: Default map parameters

2008-11-17 Thread Rich Hickey
On Nov 17, 5:16 pm, "Mark Volkmann" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 17, 2008 at 3:48 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > On Nov 17, 4:22 pm, samppi <[EMAIL PROTECTED]> wrote: > >> Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b..., > >> the following

Re: Newbie: Default map parameters

2008-11-17 Thread samppi
Ah! Thank you. On Nov 17, 2:48 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Nov 17, 4:22 pm, samppi <[EMAIL PROTECTED]> wrote: > > > Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b..., > > the following example was given: > > > (defn test1 [{x :x, y :y, :or {:y 3}}] > >

Re: Newbie: Default map parameters

2008-11-17 Thread Mark Volkmann
On Mon, Nov 17, 2008 at 3:48 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > On Nov 17, 4:22 pm, samppi <[EMAIL PROTECTED]> wrote: >> Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b..., >> the following example was given: >> >> (defn test1 [{x :x, y :y, :or {:y 3}}] >>

Re: Newbie: Default map parameters

2008-11-17 Thread Rich Hickey
On Nov 17, 4:22 pm, samppi <[EMAIL PROTECTED]> wrote: > Inhttp://groups.google.com/group/clojure/browse_thread/thread/62140a28b..., > the following example was given: > > (defn test1 [{x :x, y :y, :or {:y 3}}] > [x y]) > (test1 {:x 2}) => [2 3] > > But this doesn't work on the latest Clo

Newbie: Default map parameters

2008-11-17 Thread samppi
In http://groups.google.com/group/clojure/browse_thread/thread/62140a28b8d4ef36, the following example was given: (defn test1 [{x :x, y :y, :or {:y 3}}] [x y]) (test1 {:x 2}) => [2 3] But this doesn't work on the latest Clojure from Subversion I just got: (test1 {:x 2}) => [2 nil] Was