Btw. I'm using [match "0.2.0-SNAPSHOT"] and Clojure 1.3 but this import instruction
(use '[match.core :only [match]]) from official website of match library doesn't work, only (use '[clojure.core.match.core :only [match ] ]) works and I have given a try to matchure and IT WORKS ;-) But why do I have to define question character as a prefix on destruction variables? This doesn't help in any way and I doubt that is helps matchure too. And here is the contest winning code: http://pastebin.com/w7sKH0Pw Thanks to all and looking to match library being fixed or explained what is wrong with previous code. See you later! On Sep 30, 10:36 am, Michael Jaaka <michael.ja...@googlemail.com> wrote: > Thanks for feedback. But now I'm came across a problem. I'm studying > "Learn You a Haskell for Great Good!" and I'm on chapter "Functionally > Solving Problems" reading "Reverse Polish notation calculator". > I wanted to write it in Clojure. So instead of:http://pastebin.com/QzhbyD6d > > I wrote:http://pastebin.com/fsChN96D > > But as you can see the first try doesn't work as expected. > The destruction of stack doesn't work as expected. > Expectation is written below as let expression. > > Anyone? > > On Sep 30, 6:56 am, Kevin Downey <redc...@gmail.com> wrote: > > > > > > > > > Last I checked matchjure generates fns which break recur (there is an issue > > open for it). Trading recursion for matching seems like a bad deal, I > > recommend using match instead. > > On Sep 29, 2011 4:32 AM, "Christian Pohlmann" <chr.pohlm...@googlemail.com> > > wrote: > > > > Additionally to core.match there is also matchure [1] which comes with > > > a defn-match that can be used like this: > > > > (defn-match choose > > > ([_ 0] 1) > > > ([0 _] 0) > > > ([?n ?k] (+ (choose (dec n) (dec k)) (choose (dec n) k)))) > > > > This makes defining functions fairly close to what you're used from > > Haskell. > > > > [1]https://github.com/dcolthorp/matchure > > > > Christian > > > > On Thu, Sep 29, 2011 at 12:03 PM, Michael Jaaka > > > <michael.ja...@googlemail.com> wrote: > > >> Hi! > > > >> Is there any way to define function with pattern matching in function > > >> signature as it is in haskell? > > > >> Bye! > > > >> -- > > >> 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 > > > > -- > > > 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 -- 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