all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Omar Polo <op@omarpolo.com>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: cl-delete-if vs list of overlays
Date: Wed, 09 Dec 2020 12:05:17 +0100	[thread overview]
Message-ID: <87wnxrfdea.fsf@omarpolo.com> (raw)
In-Reply-To: <874kkv706i.fsf@gnuvola.org>


Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> () Omar Polo <op@omarpolo.com>
> () Wed, 09 Dec 2020 10:53:26 +0100
>
>    Why is cl-delete-if not removing items from the list?  (setq
>    delp t) evaluates to t, so it should delete.  cl-delete-if a
>    destructive function.  This is what I'm not getting.
>
> On my system, ‘C-h f cl-delete-if RET’ sez:
>
>  This is a destructive function; it reuses the storage of SEQ
>  whenever possible.
>
> So, your question becomes: When is it NOT possible to reuse the
> storage of SEQ in the process of deleting an item?

Oh my, I feel so stupid now...

I was under the (wrong) assumption that a destructive function will
always modify the list, when it's not the case.  I needed to setq the
result of cl-delete-if to the list itself to cover all the cases.

Thanks!



  reply	other threads:[~2020-12-09 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  9:53 cl-delete-if vs list of overlays Omar Polo
2020-12-09 10:17 ` Thien-Thi Nguyen
2020-12-09 11:05   ` Omar Polo [this message]
2020-12-09 16:14     ` Drew Adams
2020-12-09 18:16     ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnxrfdea.fsf@omarpolo.com \
    --to=op@omarpolo.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ttn@gnuvola.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.