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

Re: SRFI-1: suggestion for addition: LDIFF

This page is part of the web mail archives of SRFI 1 from before July 7th, 2015. The new archives for SRFI 1 contain all messages, not just those from before July 7th, 2015.

>>>>> "Will" == Will Fitzgerald <fitzgerald@xxxxxxxxxxxx> writes:

Will> May I suggest the following addition to the SRFI-1 list library, Common Lisp's
Will> LDIFF:

Will> I think a reasonable definition is:

Will> (define (ldiff l subl)
Will>   (cond
Will>    ((null? l) '())
Will>    ((eq? (cdr l) subl) (list (car l)))
Will>    (else (cons (car l)
Will> 	       (ldiff (cdr l) subl)))))

Reasonable.  Only, LDIFF is a terrible name.  Why not LIST-DIFFERENCE?
(From CltL2: 'ldiff (meaning "list difference" [...]'.  I wonder why
the CL folks never say what they mean.)

Could you suggest possible uses for this procedure?

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla