On Dec 2, 2:08 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Dec 2, 12:16 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> > In Ruby, most things match by value equality. But
> > classes match their instances. Ranges match things in the range.
> > Regexps match strings that they would match against.
> fcase/condf, which I'd like to get in, here:
>
> http://groups.google.com/group/clojure/browse_frm/thread/dee910bef629...
> Also, I think people will want a true structural match macro at some
> point (yesterday).
Here is a wide-open design space of facilities with overlapping
functionality that can be put to a wide variety of different
purposes. cond clauses, case statements, generic procedure
dispatch a la CLOS, pattern-directed invocation a la ML and
Haskell, destructuring function arguments into formal parameters,
destructuring data structures by patterns, matching regular
expressions, and even pattern matching for operating a rule-based
deduction system all consist of two basic components: which
pattern successfully matches determines the code to be executed
next, and the bindings to the variables of that pattern are
handed to that next piece of code. They vary in how much each
aspect is emphasized and in the language of permissible patterns,
and in the user-extensibility of the pattern language and the
match sites. I would love for someone to work out a coherent
Grand Unified Theory of Pattern Matching. Failing that my two
cents are to suggest that the design of constructs in this space,
like fcase or ===, would benefit from conciously carving out an
appropriate chunk of the space for them to inhabit.
~Alexey
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---