> Extra pair of []? What do you mean? Sorry, my bad.
-sun On Jan 15, 1:25 pm, James Reeves <weavejes...@googlemail.com> wrote: > On Jan 15, 2:54 pm, wubbie <sunj...@gmail.com> wrote: > > > But in partial desctructuring, [[a [b]] has extra pair of outer-most > > [] which leads to confusion. Any explanation on that? > > Extra pair of []? What do you mean? > > The destructuring pattern is: [[a [b]] & leftover] > The pattern you're matching is: (("one" ("two")) "three" ((("four")))) > > So: > a = "one" > b = "two" > leftover = '("three ((("four")))) > > All seems pretty correct to me. Is it just the "&" that's confusing? > > > Also not sure about the last (on strings). > > Well, if you turn a string into a sequence, you get a sequence of > chars. \a is a char, so (seq "abc") is (\a \b \c). > > The destructuring pattern is: [a b c & leftover] > The pattern you're matching is: (\1 \2 \3 \g \o) > > So: a = 1, b = 2, c = 3 and leftover = (\g \o) > > Does that make things any clearer, or have I just confused you > further? :) > > - James --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---