On Dec 2, 12:16 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> It is called "case equality" which is a terribly confusing way to say
> "the predicate used to match in case statements". "Match" is really
> the best verb. 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.
>
> I find the construct useful, but difficult to define. In particular,
> if regular expressions match against matching strings, should
> collections match against their members? Subsets?
>
> The use case I have in mind for Clojure is in unit tests, where one
> might say something like
>
> (each-matches
> [actual-value expected-value]+)
>
> and have the match operator applied.
>
I'm pretty sure I don't like the sound of that at all. We had a nice
discussion about fcase/condf, which I'd like to get in, here:
http://groups.google.com/group/clojure/browse_frm/thread/dee910bef6296035/d1858b3b0233183e
I think a predicate match system is much nicer than a fuzzy-value
match.
Also, I think people will want a true structural match macro at some
point (yesterday).
Rich
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---