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

Order of arguments to sequence :TEST functions



    Date: Mon, 29 Feb 88 09:34 EST
    From: David C. Plummer <DCP@QUABBIN.SCRC.Symbolics.COM>

    CLtL page 247 says
	    ... (funcall testfn item (keyfn x)) ...
    I'm curious to know why this order was chosen instead of
	    ... (funcall testfn (keyfn x) item) ...

The design rationale is given just a few lines lower on the same
page.  The order of arguments to the testfn is kept consistent with
the order of arguments to the sequence function in question.

    Was there a reason for the ordering choice?  Does anybody depend on it, or
    know of somebody that does?  Is there any chance of CLtL'89 reversing
    it (and documenting the reason in the text)?

Yes.  Yes.  I hope not.  Changing the order of arguments to something, in
a way so that the incompatibility cannot be mechanically detected and
warned about or assisted with, is the worst kind of incompatible change
from a user point of view.

    What I was trying to do was use FIND to find an item of a certain type,
    as in
	    (find type sequence :test #'typep)
    but the order of the arguments as defined in CLtL is backwards.

Looks like a job for LAMBDA.