[r6rs-discuss] Why are fx+ and fx* restricted to two arguments

From: Mikael Tillenius <mti>
Date: Sun Feb 18 07:40:16 2007

In section 9.1 fx+ and fx* are defined as taking exactly two arguments
with the following comment:

"Rationale: These procedures are restricted to two arguments
because their generalizations to three or more arguments would
require precision proportional to the number of arguments."

I still don't understand why. The programmer must make sure that no
overflow happens (or be prepared to handle the overflow) independent of
the number of arguments. Two arguments may overflow as well as ten.

I can see many reasons for having more than two arguments. E.g (define
(intensity r g b) (fxdiv (fx+ r g b) 3)) when I know all of the
arguments are between 0 and 255.

Can someone enlighten me?

/Mikael
Received on Sun Feb 18 2007 - 07:40:47 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC