sassq



On 2/22/2013 11:56 PM, Andreas Eder wrote:
> Hi,
>
> the function 'sassq' is only used in sin.lisp and there never in
> its full generality. In fact it is always called with 'nill' as
> the default function parameter (except in one place where it is
> called erroneously with nil).
yes, that seems to be a bug, but perhaps one that is not accessible.
> It is used, so that when assoc
> doesn't find the key it returns a constatnt list of one dummy
> argument nil, so cdr has something to work on.
> But since in Common Lisp the cdr of nil is nil, that
> construction is not needed!
> What do you think: should we just replace sassq with assoc in that
> few places?
>
> Andreas
The cdr of nil is always nil. The code was presumably written with some
other argument than #'nill somewhere, but that was dropped.



(sassq X Y #'nill) has the same meaning as (assoc X Y :test #'eq) which is
the default test, I think.  so (assoc X Y) works as well.

I agree with your analysis.

Furthermore there appear to be no calls for nill remaining in the code if
sassq is removed, so its definition could be removed, I think.

RJF