From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#33998: 27.0.50; cl-delete does not delete the first list element Date: Tue, 8 Jan 2019 18:57:12 +0000 Message-ID: References: <87muodud4d.fsf@aia00054aia.gr> <39367b1c-ea27-4627-99e3-eb7d0745c60f@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546973769 5426 195.159.176.226 (8 Jan 2019 18:56:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Jan 2019 18:56:09 +0000 (UTC) Cc: 33998@debbugs.gnu.org, Deus Max To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 08 19:56:04 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggwXk-0001JP-51 for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2019 19:56:04 +0100 Original-Received: from localhost ([127.0.0.1]:43863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggwZq-0005li-1o for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2019 13:58:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggwZg-0005iW-T5 for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 13:58:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggwZe-00085n-2P for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 13:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggwZd-00085C-Uq for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 13:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggwZd-0003uE-On for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 13:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jan 2019 18:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 33998-submit@debbugs.gnu.org id=B33998.154697385514978 (code B ref 33998); Tue, 08 Jan 2019 18:58:01 +0000 Original-Received: (at 33998) by debbugs.gnu.org; 8 Jan 2019 18:57:35 +0000 Original-Received: from localhost ([127.0.0.1]:50253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggwZD-0003tV-AD for submit@debbugs.gnu.org; Tue, 08 Jan 2019 13:57:35 -0500 Original-Received: from mail-qt1-f175.google.com ([209.85.160.175]:39344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggwZ8-0003tD-81 for 33998@debbugs.gnu.org; Tue, 08 Jan 2019 13:57:30 -0500 Original-Received: by mail-qt1-f175.google.com with SMTP id u47so5576507qtj.6 for <33998@debbugs.gnu.org>; Tue, 08 Jan 2019 10:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Gv48RKGf7OPlel8pv6NIaShvuLExWBV5yDtPEP4rX1M=; b=XtMaU6Iut3ACyzcq8ZGSKlnkBtHCjiJou9IGn5COH15iJjWm3WnxnNfIXHhtf+y2uZ KWLzY/y3O1VoSzj1o8XCL1bzUetyXMk6uVRsSn2zygw9ZzZ7wSjU+65wokN4VanRX6EI 3lLiveH5YXyippmWEHVMG3+xMTdglEjkz0Z+zEh8JHTGCBUqK5SZP2DonnSjNmQy1Vlw BGkSVjqpzkNbIDh3EDzROHsGYfNLU3itMAao6g3PWZOPjMNyiBmp2MlXPczXR+0FFtEu nGQr51FWNPsbhpYQKG4Upbik7oR2D+BofJ3/ieHIWif0p+1+2lebMUejKpCmkUFr8b3u bsbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Gv48RKGf7OPlel8pv6NIaShvuLExWBV5yDtPEP4rX1M=; b=KwttyW48TZCCLWBSrS3TM5kh0pYvkcLpoyDH6yD4/U4JewHEC9Qta0IiA2Jw3gJyaI K23JzyuX1YtcyWyI1Cb+jeO73ZfPYtKRCm53lYd1ZaY3fghy6NpC5SdMEzgZT2Y8ex07 aSghSxRfm9QtncC+yC/UOLnjus4jVKWTYY0O9cno1AQJ7FA3Ugd04o3mn04Qa5bH01e5 nP2efOJy1xkTYnjRoitjSuAJzvCekjv562wflBrIfgLl8Y0aiTTBb9Mc+yVKgKkKR7oF xq3vchBt+cOAm5TgokvRCl/5hvsnLU5hk5ZX2/Zy6vYzaGwfp5+gA0L3VS1NUWkB68pk 8XXA== X-Gm-Message-State: AJcUukctDi2ippkjKT2mGoqhw1wubMr4NxQ2IEvQFym5y93Z4RakeqPT Td3l1WRXd8pwtmAfQr09WhooesstxlAyJO9zNIY= X-Google-Smtp-Source: ALg8bN5HV7zsD8NuxCzs0V2D/S5sYmLxPOQTpvM9KBvkyNH6E+EcGdtLXUOEM7qJLmtrWFCX5Dvyybn5/P3ycu4v2SQ= X-Received: by 2002:ac8:3e91:: with SMTP id y17mr2913799qtf.390.1546973843937; Tue, 08 Jan 2019 10:57:23 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154268 Archived-At: On Tue, Jan 8, 2019 at 6:46 PM Drew Adams wrote: > > > > Again, you should set the variable to the value > > > returned by `cl-delete' only if that's what you > > > want > > > > OK. Say you don't. Say you don't SETQ the variable > > to the return value. What do you expect to be left > > with in the value bound to the SEQ symbol? > > > > > Pretty simple, really. > > > > Then answer the pretty simple question above. > > Without setting variable `seq' (i.e., without > the `setq'), that variable is still bound to > whatever it was bound to prior to your invoking > `(cl-delete thing seq)'. Presumably it was > bound to a cons. It could have been bound to a vector. cl-delete (as delq, delete) accepts sequences. And contrary to those two, it makes no guarantees as to how it potentially destroys the original sequence. So unless you're relying on a particular implementation, relying on SEQ after calling cl-delete on it is a bad, bad idea. So yes, always (setq SEQ (cl-delete THING SEQ)). With the extraordinary exception that you're leaving the scope where SEQ is visible. Then you can bypass it. Jo=C3=A3o