On Fri, May 13, 2011 at 2:04 AM, Heinz N. Gies <[email protected]> wrote:
> Hearing Pattern Matching,
> do you mean Erlang like Pattern matching?
>
> Regards,
> Heinz
Erlang, OCaml, SML, Haskell, Scala all have the kind of pattern matching I'm
talking about. One important point is that they all support guards on
patterns. It's not clear to me that current implementation actually use
guards to shape the tree, but that is my plan. In the system I'm proposing
guards are actually logical predicates that can be reasoned about.
(match n
([x] :guard [(number? x)]
...)
([0] ...))
This is not ok in OCaml, SML, or Haskell (or Scala and Erlang as far as I
know). This would be ok in the system I'm proposing since number? is a
logical predicate and we can test for such cases and reorder the pattern.
David
--
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