Hi,
core.match might be what you're looking for.
(defn append [a b]
(match [a b]
[[] _] b
[[x & as] _] (append as (cons x b)))
(defn or [b1 b2]
(match [b1 b2]
[true _] true
[_ true] true
:else false))
https://github.com/clojure/core.match
Thanks,
Ambrose
On Thu, Sep 29, 2011 at 6:03 PM, Michael Jaaka <[email protected]
> 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 [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en