From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#33998: 27.0.50; cl-delete does not delete the first list element Date: Tue, 8 Jan 2019 11:07:03 -0800 (PST) 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 1546974397 24494 195.159.176.226 (8 Jan 2019 19:06:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Jan 2019 19:06:37 +0000 (UTC) Cc: 33998@debbugs.gnu.org, Deus Max To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 08 20:06:33 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 1ggwht-0006F9-7M for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2019 20:06:33 +0100 Original-Received: from localhost ([127.0.0.1]:44916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggwjz-0002sb-Uj for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Jan 2019 14:08:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggwjN-0002QJ-6l for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 14:08:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggwjL-0004QV-5e for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 14:08:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50977) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggwjL-0004On-0r for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 14:08:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ggwjK-0004AI-Fp for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 14:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jan 2019 19:08:02 +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.154697443415944 (code B ref 33998); Tue, 08 Jan 2019 19:08:02 +0000 Original-Received: (at 33998) by debbugs.gnu.org; 8 Jan 2019 19:07:14 +0000 Original-Received: from localhost ([127.0.0.1]:50258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggwiY-000496-CL for submit@debbugs.gnu.org; Tue, 08 Jan 2019 14:07:14 -0500 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:45914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggwiV-00048r-Rh for 33998@debbugs.gnu.org; Tue, 08 Jan 2019 14:07:12 -0500 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x08J4GQF038941; Tue, 8 Jan 2019 19:07:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=f6H5huILAp2QHwri4LtKZJ92TvQPTjIk0u8cSggkofg=; b=H/ldo5saDPWp34qdCf7ztrhm0NPLyMxMDQ9jx/Gd2/ZwZbW/T+/9PUAzLWst553XUO4Z 22pw47yX8qU2HkBPZqUhnW/2dp9ZlZDWsSRy0ap8Sa8AXoEAv4G1Ae4A6KQ8jzD8I/op TBfaTbOHVPdCBicYUa2UT4MDshlZV8xFpwK4EhsoBoStaGm4y9LS4LnF/CGl2Uyr9Bl3 EVMOWccWLdyEotNfwOMJvH8hTMzdIlbVhZB8lmS255w0rxqksTAEs9T4mUE98PHFS+yE CH9/O0sBsAae7SCzJAa9eoLNdEjc8Cef9T9AsGNLvAfjkMNqqy8DUZf/58xDfHWkYCU8 Qw== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2ptj3dwmug-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Jan 2019 19:07:05 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x08J741J020059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jan 2019 19:07:05 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x08J746j026749; Tue, 8 Jan 2019 19:07:04 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4783.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9130 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=674 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901080151 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:154269 Archived-At: > > 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. >=20 > 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. >=20 > 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. I'm repeating myself, so I'll stop here. You are _not_ "calling cl-delete on it", where "it" is the variable SEQ. You are calling the function on its value, whether that value is a vector, a list or any other kind of sequence. `cl-delete' never sees, smells, or hears the variable. It all depends what a user intends by "relying on SEQ". If you ALWAYS mean relying on its value to be what `cl-delete' returns then sure, clearly you must ALWAYS set it to that return value. If in some case you instead mean relying on it not to be affected by `cl-delete' then you won't want to assign it to the result of invoking `cl-delete'. It's not about implementation of `cl-delete'. It's not about the type of sequence you pass it. It's about a variable being something different from its value.