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: multi-assignment setq [was: setq's with missing final arguments.] Date: Mon, 23 Nov 2015 08:58:48 +0100 Message-ID: <87h9kdp2o7.fsf@gmail.com> References: <20151122122657.GA2332@acm.fritz.box> <87si3yp5y6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448265589 11651 80.91.229.3 (23 Nov 2015 07:59:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2015 07:59:49 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 23 08:59:33 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 1a0m26-0005j8-UT for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 08:59:31 +0100 Original-Received: from localhost ([::1]:59071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0m22-0007Jf-Al for ged-emacs-devel@m.gmane.org; Mon, 23 Nov 2015 02:59:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0m1o-0007JW-9z for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:59:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0m1l-0005Wj-4N for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:59:12 -0500 Original-Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0m1k-0005WZ-U4 for emacs-devel@gnu.org; Mon, 23 Nov 2015 02:59:09 -0500 Original-Received: by wmuu63 with SMTP id u63so42611682wmu.0 for ; Sun, 22 Nov 2015 23:59:08 -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=mkOSOJcvMeYearxv2Lz+lmmXMGTNPxZXXaacOdfHGbA=; b=yMiJvAMgtHaNvJ83Sc/i1hldN0GyEhayDq9aXEuVnJ9eq4/KOtRM/VSAp8ZFkNghmx 7YgguxqK6q6lBYfOY3opaXt3erEqzqwcjqKQaewxkCWwGv5Bh8V++DxulN77YAgh1/Ix XodAmQSaaKEZRQoc2aDtfhKpQTXGYbe3QDLiK/9blgtSKNRaiRbszkRjo5p/wqIHpN1I 6ONkATI0y2Hpl+MmHKU4Oswa5wl6o4StNgg8w6OJ0f27l9InjqOiq+4i+iGr7sNR7jPm WeQnjg9oxKu/eILLN339uvQVM6zKP0CgAToHw/fuXODrHXF9DwvKnLckdf7V/EIfy45X gFwQ== X-Received: by 10.194.243.6 with SMTP id wu6mr28312880wjc.14.1448265548310; Sun, 22 Nov 2015 23:59:08 -0800 (PST) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id u4sm11901000wjz.4.2015.11.22.23.59.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 22 Nov 2015 23:59:07 -0800 (PST) In-Reply-To: (Drew Adams's message of "Sun, 22 Nov 2015 07:53:52 -0800 (PST)") 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::233 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:195099 Archived-At: Drew Adams writes: >> 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 > > That quality is not what I consider "lispiness". That same > complaint applies to `let*' and a zillion other Lisp veterans. By "lispiness" I mean the sexp structure that allows you to manipulate code in a foolproof way and navigate it easier. That sexp structure also applies to `let*', but doesn't apply for example to Clojure's `let'. For example of being foolproof, exchanging the order of two `setq' statements is a well defined, simple to automate operation. You can pull it off with `transpose-sexps' if you position the point just right. Alternatively, `kill-sexp' when positioned before the open paren can also work for this. On the other hand, multi-assignment setq isn't foolproof. You have to count from sexp's start and make sure that you kill/paste starting from the odd numbered list child and not from the even numbered. It's a hassle that can easily be avoided. Using single-assignment setq adds only 6 chars per assignment, compared to multi-assignment setq and: - it reads better - it navigates better (`forward-list' and `backward-list') - it manipulates better