[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [r6rs-discuss] [Scheme-reports] redefining eqv?
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
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
r6rs-discuss mailing list