On Fri, 2009-08-21 at 11:02 -0700, Sigrid wrote: > Hi, > > I read the related story on InfoQ and found it an extremely > interesting and motivating read, Clojure being applied in such an > interesting field as machine learning! > > There is something in the article I'd like to understand better, so > i'm just asking here on the group: > > "The way that Rich elected to de-couple destructuring bind from > pattern matching was brilliant." > > Could someone point me to what the difference is? I know pattern > matching e.g. from the PLT scheme implementation, and there the > pattern matching also provides the binding and destructuring I > think...? > Clojure allows destructuring of vectors, which happens to be what its functions' argument lists are, so you get most of the benefits of pattern matching. It's not full-blown, though, so (correct me if I'm wrong) the equivalent of this is not possible:
length [] = 0 length (_:xs) = 1 + (length xs) Regards, -- Michel --~--~---------~--~----~------------~-------~--~----~ 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 post. 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 -~----------~----~----~----~------~----~------~--~---