[Top][All Lists]

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

Re: remove sublist

From: Emanuel Berg
Subject: Re: remove sublist
Date: Thu, 12 Apr 2018 17:10:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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) )

underground experts united

reply via email to

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