Re: [Scheme-reports] [r6rs-discuss] redefining eqv?
Eli Barzilay 24 Dec 2010 16:00 UTC
Three hours ago, Peter Kourzanov wrote:
> On Fri, 2010-12-24 at 20:49 +0900, Adrien "Pied" Piérard wrote:
> >
> > 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.
Please don't put words in my mouth. If you're using an implementation
with a module system, then you can define any `case' you want without
affecting my code.
> 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.
You're talking about a customized equality predicate, which is not
what `eqv?' is doing. (The reason that `case' is using `eqv?' in the
first place is to allow efficient compilation, similar to a C
`switch' statement.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports