[r6rs-discuss] Comparison procedures' number of arguments

Alan Bawden Scheme at Bawden.Org
Tue Oct 21 00:57:07 EDT 2008


   Date: Mon, 20 Oct 2008 20:09:51 -0700
   From: Thomas Lord <lord at emf.net>
   Cc: r6rs-discuss at lists.r6rs.org

   Alan Bawden wrote:
   > Stop being so argumentative 
   >   

   I'm sorry I made a dumb mistake in my example but please
   don't attack my character as a result.

Actually, it was a very interesting mistake.  I thought the way in which
your proposed transformation failed was very enlightening.  My cranky
reaction was not because your original mistake was "dumb", but because when
I pointed out the error, you continued to argue without realizing that I
had in fact pointed out an error.

   Here's a better, simpler, corrected example:

   (apply = x)        ; true when the elements of x
		      ; are all equal
   <=>

   (let ((xv x))
				 ; the elements of x are all =
     (not                        ; if it is false that
       (exists                   ; there exists
	 (lambda (x0)            ; some element of x ("x0")
	   (exists               ; such that for that x0 there exists
	     (lambda (x1)        ; another element of x ("x1")
	       (not              ; where it is not the case that
		 (= x0 x1)))     ; those elements are equal
	      xv))
	  xv)))

   Now, to be clear, I think that second transformation is
   also a bogus transformation because my opinion is that
   (apply = '(q)) ought to be an error, not #t -- but if we stipulate
   that "x" denotes a list of numbers then the transformation
   is not bogus.

For `=' it is indeed not bogus.  Unfortunately, substituting `<' for `=' in
the above equivalence results in something that -is- bogus.  So while you
may be able to use this example to argue that `(=)' should return #T, you
can not use it to argue that `(<)' should return #T.



More information about the r6rs-discuss mailing list