[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
four issues for R5RS meeting at Xerox PARC
Section 6.5.3 should be clearer about what (/ 5 3) should do in an
integers only implementation and in the case of an implementation with
inexeacts but no rational numbers.
Implementations are encouraged, but not required, ... and to
implement the above procedures and the / procedure in such a way
that they always return exact results when given exact arguments.
If one of these procedures is unable to deliver an exact result when
given exact arguments, then it may either report a violation of an
implementation restriction or it may silently coerce its result to
an inexact number. Such a coercion may cause an error later.
As stated, (/ 5 3) should return 1 even if the implementation had
inexact numbers. It should say something about the Mathematically
expected result (as it does for the other functions in the paragraph
before the one I quoted). There was some discussion of this last year
but I can't find copies of the messages.
On other things numerical, I would like to see the number-theoretic
functions QUOTIENT, REMAINDER, MODULO, GCD, and LCM not be required to
accept inexact numbers. To my mind, (gcd 32.0 -36) is an error and I
would like Scheme to catch this for me. INEXACT->EXACT is always
available to convert if neccessary.
Similarly, I would like the transcendental functions EXP, LOG, SIN,
COS, TAN, ASIN, ACOS, ATAN, MAKE-RECTANGULAR, MAKE-POLAR, and ANGLE
not be required to accept exact arguments. When I take SIN of an
exact number it is because I forgot to multiply it times pi. I would
appreciate Scheme catching this error for me. I expect this is true
in the vast majority of cases. EXACT->INEXACT is always availble for
the one in a million program which actually wants (SIN 1).
Do any implementations have APPLY which accepts only 2 arguments? If
not, could APPLY of more than 2 arguments be made essential or is
there some other rationale for this?