From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: setq's with missing final arguments. Date: Sun, 22 Nov 2015 13:31:53 +0100 Message-ID: <87lh9q9pvq.fsf@fencepost.gnu.org> References: <20151122122657.GA2332@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448197586 9007 80.91.229.3 (22 Nov 2015 13:06:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 13:06:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 22 14:06:20 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 1a0ULT-0002dc-RZ for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 14:06:20 +0100 Original-Received: from localhost ([::1]:55985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0ULT-00069J-Iu for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 08:06:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0UL6-000680-Hg for emacs-devel@gnu.org; Sun, 22 Nov 2015 08:05:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0UL5-0001Zo-P3 for emacs-devel@gnu.org; Sun, 22 Nov 2015 08:05:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0UL5-0001Ze-Lw; Sun, 22 Nov 2015 08:05:55 -0500 Original-Received: from localhost ([127.0.0.1]:56208 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1a0UL4-0000Yn-QI; Sun, 22 Nov 2015 08:05:55 -0500 Original-Received: by lola (Postfix, from userid 1000) id 6E407DF8DA; Sun, 22 Nov 2015 13:31:53 +0100 (CET) In-Reply-To: <20151122122657.GA2332@acm.fritz.box> (Alan Mackenzie's message of "Sun, 22 Nov 2015 12:26:57 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:195006 Archived-At: Alan Mackenzie writes: > Hello, Emacs. > > Consider this file: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > (defvar foo t) > (defvar bar t) > > (defun bad-setq () > "Doc string" > (setq foo 5 > bar)) > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > 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: [...] > Any objections? Yes. This is not a case for a warning. It's an error. It does not match the documented definition of setq. -- David Kastrup