From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.help Subject: Re: cl-delete-if vs list of overlays Date: Wed, 09 Dec 2020 12:05:17 +0100 Message-ID: <87wnxrfdea.fsf@omarpolo.com> References: <87zh2nfgq1.fsf@omarpolo.com> <874kkv706i.fsf@gnuvola.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19361"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.13; emacs 27.1 Cc: help-gnu-emacs@gnu.org To: Thien-Thi Nguyen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 09 12:06:56 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmxJA-0004wk-7L for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Dec 2020 12:06:56 +0100 Original-Received: from localhost ([::1]:45854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmxJ7-0001Fx-Am for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Dec 2020 06:06:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmxHp-0001Ez-21 for help-gnu-emacs@gnu.org; Wed, 09 Dec 2020 06:05:33 -0500 Original-Received: from mail.omarpolo.com ([144.91.116.244]:55398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmxHl-00007D-UB for help-gnu-emacs@gnu.org; Wed, 09 Dec 2020 06:05:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1607511918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qGSyJKyJ1HFhn24ThJTKMxQ5CJmfJDcjPQatMFBDrlA=; b=Gk7zA0fhnckqP+SaSjJxsogzDdh0T3fBztGGXjpqldRymi1F8IRCQCQ+PM5D1toEV2FL05 lsi0of9qLqBanf5jmjTdXlqSqU0y+owfPnE0XkJvyyAesOCg4TBvdxK82p21YX6fMSV1vJ fayivNYjr7pheQe7rYcqevwpWNcz/Bk= Original-Received: from localhost (host-80-116-112-105.pool80116.interbusiness.it [80.116.112.105]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id ab22f51c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 9 Dec 2020 12:05:18 +0100 (CET) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id aaae95cd; Wed, 9 Dec 2020 12:05:17 +0100 (CET) In-reply-to: <874kkv706i.fsf@gnuvola.org> Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126187 Archived-At: Thien-Thi Nguyen writes: > () Omar Polo > () 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, =E2=80=98C-h f cl-delete-if RET=E2=80=99 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!