> On Aug 25, 11:27 am, Stuart Halloway <[EMAIL PROTECTED]>
> wrote:
>>> It's a bit apples and oranges emulating pattern matching and case
>>> classes with multimethods, but very illustrative. It's important to
>>> note that the Scala code is using type tags, not values, in doing  
>>> the
>>> match, so I think using tags rather than looking for non-zero values
>>> is more similar:
>>
>> You're stealing my thunder.
>
> Sorry, that wasn't my intent.

Adding explicit smiley face: :-)

>>> A critical difference, IMO, is that pattern matches are closed, and
>>> multimethods are open:
>>
>> With Scala extractors, pattern matches can be open too.
>
> Interesting. By that do you mean an existing match can work with
> subsequently-defined types or that new 'cases' can effectively be
> added later? Do you have a pointer to an example of the latter?

The former is easy. It's not obvious to me how to do the latter, but  
my instinct is that it could be done with some extractor trickery. If  
I come up with an example I will post it.

Stuart


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to