Email list hosting service & mailing list manager


Re: [scheme-requests-for-implementation/srfi-144] Apply changes from John Cowan (except ^Ms). (20da2d4) William D Clinger 25 Jun 2017 23:02 UTC

First, some context:  I wrote

> If flexponent was intended to behave like logb, then its specification
> should say it always returns an inexact integer when given a finite
> flonum argument, truncating the base-2 logarithm of the absolute value
> of its argument towards zero.

John Cowan responded:

> The Posix specification of logb does say so; remember that the SRFI 144
> text is merely informative.  But I'll modify the SRFI along the lines you
> specify to avoid confusion.

Now that we've agreed upon that change, I'm wondering whether it might
be a good idea to change the SRFI 144 specifications of flfirst-bessel
and flsecond-bessel so they align with the cited C99 functions jn and
yn, which take their arguments in the opposite of the order specified
by the current draft SRFI.  The C99 order of arguments is more like
conventional math notation, J_n(x) and Y_n(x) corresponding to jn(n, x)
and yn(n, x) more closely than to

    (flfirst-bessel x n)
and (flsecond-bessel x n)

As evidence that the current draft of SRFI 144 might lead to confusion,
I suspect Alex Shinn got the order reversed in his FFI-based code by
using the C99 order of arguments instead of the SRFI 144 order.

A third alternative is to curry the arguments:

    ((flfirst-bessel n) x)
    ((second-bessel n) x)

That would improve the correspondence with mathematical notation at the
expense of correspondence with the C99 order of arguments.  Even so, it
would be better than the current specification, which corresponds to
neither mathematical notation nor to the C99 order of arguments.

Will