From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: Re: setq's with missing final arguments. Date: Sun, 22 Nov 2015 13:35:45 +0100 Message-ID: <87si3yp5y6.fsf@gmail.com> 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 1448195780 15672 80.91.229.3 (22 Nov 2015 12:36:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 12:36:20 +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 13:36:14 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 1a0TsL-00029y-Px for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 13:36:14 +0100 Original-Received: from localhost ([::1]:55735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0TsL-0007gI-6q for ged-emacs-devel@m.gmane.org; Sun, 22 Nov 2015 07:36:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0TsH-0007gB-IQ for emacs-devel@gnu.org; Sun, 22 Nov 2015 07:36:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0TsD-0003ER-IY for emacs-devel@gnu.org; Sun, 22 Nov 2015 07:36:09 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:33979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0TsD-0003ED-CS for emacs-devel@gnu.org; Sun, 22 Nov 2015 07:36:05 -0500 Original-Received: by wmvv187 with SMTP id v187so126812202wmv.1 for ; Sun, 22 Nov 2015 04:36:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=7OgLCz8xRGEy11BLuBYcJ6ZYhokwSA/EtoQ74Lr9LhY=; b=f8SoLO9U6QzPeur/977z3Skrd7dWK2dKB1e8vrM0uT/dT1XOVgXN8Ypj2L1W+oW/vH 4Nk0MFW/Thb6ZMAMFRy6SU/f6p88v9aUSnwnspVpMDW2H/QNdqFp12arPpwAf4N05QXj bLPC85hSSccSdhE9COhIlUCSoXG4W+OiwCwbfAZhvd/DVuPYBo+61B4LlSafE5yGUJ4V aZ1G/vnOAvygzmtY9VwsI2RVnOQWU3cYtQ7MDsoWla/0ssxtZBpWQ+be7fPk0uX76uhI OGtm9bGFo4Z4h/ETFogca8i5GCl5pycwn9EhIRr0tYIhtd2dgLyhDWny4LbV8okL24Py OJug== X-Received: by 10.28.214.141 with SMTP id n135mr11082161wmg.53.1448195764623; Sun, 22 Nov 2015 04:36:04 -0800 (PST) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id bg10sm8429094wjb.46.2015.11.22.04.36.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 22 Nov 2015 04:36:03 -0800 (PST) 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: 2a00:1450:400c:c09::232 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:195000 Archived-At: Alan Mackenzie writes: > 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. In my opinion, multi-variable setq should be deprecated altogether. I'm sure many people will disagree for the reasons of habit, but multi-variable setq is just plain bad: it makes LISP less lispy that it should be. For example: "(setq bar)" is a nice sexp: you can delete it, copy it, comment it, move it around - all kinds of fast, productive and clear to see things. On the other hand, "bar" is simply a part of another expression, you can do way less things with it, and you can break things in bad ways if you're not careful. It's an unnecessary mental burden on the programmer. Just my two cents. I understand very well there's only 0.1% chance to get this behavior deprecated because reasons. But a man can dream. And at least I can enforce this restriction on the contributions to my packages. Oleh