One of the changes between R5RS and R6RS is that (eqv? x x), where x is a variable whose value is a procedure, is allowed to return #f. The R6RS Rationale, section 11.5.1, says in its entirety:
The definition of eqv? allows implementations latitude in their treatment of procedures: implementations are free either to detect or to fail to detect that two procedures are equivalent to each other, and can decide whether or not to merge representations of equivalent procedures by using the same pointer or bit pattern to represent both. Moreover, they can use implementation techniques such as inlining and beta reduction that duplicate otherwise equivalent procedures. The first sentence of the rationale is only partly true: the R6RS gen-counter example shows that if procedures are not operationally equivalent, eqv? must treat them as distinct, as was true in R5RS. The second sentence does not seem to me to constitute a sufficient explanation for results like this: (let ((x (lambda (x) (+ x 1)))) (eqv? x x)) => #f rather than #t (memv cdr (list car cdr cons)) => #f rather than (cdr cons) In essence, that freedom makes procedures not really first-class: they can't be placed into data structures and taken out again reliably. Furthermore, none of the existing R6RS implementations (Racket, Guile, Chez, Vicare, Larceny, Ypsilon, Mosh) actually takes advantage of this freedom, at least at the REPL. Can someone explain the thinking of the R6RS committee here? Adv-thanks-ance. -- John Cowan co...@ccil.org http://ccil.org/~cowan The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. --Edsger Dijkstra _______________________________________________ r6rs-discuss mailing list r6rs-discuss@lists.r6rs.org http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss