help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: remove sublist


From: Eli Zaretskii
Subject: Re: remove sublist
Date: Thu, 12 Apr 2018 18:28:11 +0300

> From: Emanuel Berg <address@hidden>
> Date: Thu, 12 Apr 2018 17:10:21 +0200
> 
> Robert L. wrote:
> 
> > (defun remove-these (targets xs)
> >   (if targets
> >     (remove-these (cdr targets) (remove (car targets) xs))
> >     xs))
> >
> > (remove-these '(a e) '(a b e f o a g))
> >  ===>
> > (b f o g)
> 
> (require 'cl-lib)
> (defun drop-sublist (l subl)
>   "Every element of L that isn't also in SUBL."
>   (cl-remove-if (lambda (e) (member e subl)) l) )

The future is here:

  (require 'seq)
  (seq-difference '(a b e f o a g) '(a e))
  => (b f o g)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]