lset-difference

Andreas Bernauer <[email protected]> Thu, 2 Jun 2005 14:29:09 +0200
Newsgroups gmane.lisp.scheme.scsh
Message-ID <[email protected]>
Hi,

lset-difference computes the differences of two (or more) lists.  The
first arg is supposed to be a procedure representing equality of the arguments. 
Ie. you're supposed to call lset-difference like this:
(lset-difference = '(1 2) '(2)) ==> '(1)

However, when you forget supplying the procedure, lset-difference just returns:
(lset-difference '(1 2) '(2))  ==> '(2)

The user stays wondering, why her programm is not functioning properly.  I
think, you can easily forget that you have to supply an extra equality
operator.

If you think, I'll be the only one who forgets supplying the equality operator,
than ignore this request.  Otherwise, can you make lset-difference check its
arguments and raise an error, if the first argument is not a procedure?  With
this, another source of programming error can be easily spotted.

Yours,

-- 
Andreas
[email protected]