From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: setq's with missing final arguments. Date: Sun, 22 Nov 2015 07:52:48 -0800 (PST) Message-ID: <065d0399-7e58-465d-b57f-5ebe91695e59@default> References: <20151122122657.GA2332@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448207600 25525 80.91.229.3 (22 Nov 2015 15:53:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 15:53:20 +0000 (UTC) To: Alan Mackenzie , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 22 16:53:08 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a0Wws-00084v-Bu for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 16:53:06 +0100 Original-Received: from localhost ([::1]:56506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Wws-0006FK-FH for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 10:53:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Wwp-0006FE-5g for emacs-devel@gnu.org; Sun, 22 Nov 2015 10:53:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0Wwk-0002Ir-Vz for emacs-devel@gnu.org; Sun, 22 Nov 2015 10:53:03 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:39627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Wwk-0002II-NC for emacs-devel@gnu.org; Sun, 22 Nov 2015 10:52:58 -0500 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id tAMFqtjt023146 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 22 Nov 2015 15:52:55 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tAMFqs9M021055 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 22 Nov 2015 15:52:54 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id tAMFqs0g029319; Sun, 22 Nov 2015 15:52:54 GMT In-Reply-To: <20151122122657.GA2332@acm.fritz.box> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195028 Archived-At: > (defun bad-setq () > "Doc string" > (setq foo 5 > =09bar)) > In the setq, there is a missing argument after "bar". At the moment, > the byte compiler just generates code to assign nil to bar, without > giving any warning. IMAO, this is Very Bad. > I propose to insert code into the byte compiler to detect and warn of > this scenario: It's not just the byte-compiler. This is the (erroneous, IMO) behavior of `setq', whether interpreted or byte-compiled: (setq bar) ; bar :=3D nil (setq bar) should raise an error. The doc says that `setq' requires an even number of args. Same thing in other Lisps (e.g., Common Lisp).