[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Argument lists



        Let's add both FUNCTION-PARAMETERS and FUNCTION-PARAMETER-RANGE.
        
    Isn't the proper "Common Lisp" solution to this issue to say that the compiler
    ought to recognize calls to FUNCTION-PARAMETERS that only use the first two
    values and, in implementations where FUNCTION-PARAMETER-RANGE would be faster,
    convert those calls to calls on SYS:FUNCTION-PARAMETER-RANGE (now an internal
    function)?

Let me try to simulate KMP here, since the FUNCTION-PARAMETER-RANGE
function is being proposed for him.  Yes, a smart enough compiler could
recognize those cases of FUNCTION-PARAMETERS which could be fast and
non-consing and do the right thing.  If this were required behavior,
then people desiring speed could use FUNCTION-PARAMETERS with confidence
that there would be no consing or groveling the code for parameters that
are not really needed.  However, it would be unprecedented, and probably
a bad idea, to require that every compiler do this clever thing, and
without such a requirement many implementations would skip this.  People
writing applications like the ones KMP has in mind would not be able to
use FUNCTION-PARAMETERS if it is important to them that there be no
consing in any reasonable implementation.  On the other hand, there is
no temptatation to do consing for FUNCTION-PARAMETER-RANGE, so it would
be non-consing in any halfway decent implementation, without our having
to require explicitly that it avoids consing.

-- Scott