Re: [Scheme-reports] [r6rs-discuss] redefining eqv?
Peter Kourzanov 24 Dec 2010 12:48 UTC
On Fri, 2010-12-24 at 20:49 +0900, Adrien "Pied" Piérard wrote:
> And now comes a question from a user who reads all your debates in
> awe, but can't help thinking there's a lot of hair splitting involved.
>
> "Why not just parameterize CASE or whatever pattern-matcher with an
> equivalence predicate?"
>
> Wouldn't this solve many problems we read here?
> Would it create enough others problems to be disqualified?
>
> I believe that
>
> (case-with my-equality-predicate foo
> ((bar) quux)
> (else rofl)))
That's what I always do in my own code, which could be fine for a
semi-advanced user that redefines (case) for fun. The problem is that
the core language will lose its terseness appeal to newbies and veterans
if you proceed this way... And Eli will be unhappy if he accidentally
imports "wrong" (case) macro.
P.S. Note that both Haskell and Scala have special devices to attack
this problem (typeclasses resp. mixins). Not sure what ML is doing, but
OCaml could solve this with its OO system supposedly too.
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports