Christian

I have not been able to get my head around destructuring binding. Please
explain it to me with examples


Venlig hilsen

Emeka


On Sat, Jan 3, 2009 at 11:04 PM, Christian Vest Hansen <karmazi...@gmail.com
> wrote:

>
> Instead of throwing a1..aN around every time, you could use the result
> vector and use destructuring binding in your let clause to get a1..aN
> into that scope.
>
> Something like
>
> (let [[a1 a2 aN :as result] (your-func ...)]
>  ...)
>
> On Sat, Jan 3, 2009 at 11:57 PM, TPJ <tpri...@gmail.com> wrote:
> >
> > Is there some better way to "call" recur than that:
> >
> > (loop [ arg1 value1
> >        arg2 value2
> >        ...
> >        argn valuen ]
> >  (...) ; some stuff here
> >  (let [ (...) ; some bindings here
> >         result (my-func ...)
> >         a1 (nth result 0)
> >         a2 (nth result 1)
> >         ...
> >         an (nth result (- n 1)) ]
> >    (recur a1 a2 ... an)))
> >
> > I'd like to get rid of this a1, a2, ..., an and "call" recur in some
> > more convenient way. I've tried (apply recur result), but without any
> > success (Unable to resolve symbol: recur in this context).
> > >
> >
>
>
>
> --
>  / Kind regards,
> Christian Vest Hansen.
>
> >
>

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

Reply via email to