[r6rs-discuss] Comparison procedures' number of arguments

Thomas Lord lord at emf.net
Mon Oct 20 21:30:09 EDT 2008


Alan Bawden wrote:
> I've deleted the message, but somebody wrote:
>
>      Is this a valid program transformation?
>
>      (apply = (append x y z))
>
>      <==>
>
>      (let ((x0 x)
> 	   (y0 y)
> 	   (z0 z))
>        (let* ((xy (append x0 y0))
> 	      (yz (append y0 z0)))
> 	 (and (apply = xy)
> 	      (apply = yz))))
>
> This is -not- a valid program transformation.  Consider the case where y is
> the empty list.
>   


It wasn't meant as a question of "what does R6 do".

It was meant to show what you asked for: a model (in this
case for an optimization or pessimization, depending on
circumstance) that is much harder to explain and implement
if you insist on those arity checks.   The arity checks for
which you offer the rationale that they just "seem right".

-t





More information about the r6rs-discuss mailing list