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

Reply via email to