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: humble proposal: New special form progn-1 Date: Wed, 27 Jul 2016 08:15:17 -0700 (PDT) Message-ID: <54a95c7d-a709-4dba-b72b-68fbd063a916@default> References: <3d003b0a-6d60-1081-5a6f-6324add22e79@gmail.com> <5798C59D.8000308@orcon.net.nz> 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 1469634823 3667 80.91.229.3 (27 Jul 2016 15:53:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2016 15:53:43 +0000 (UTC) To: Phil Sainty , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 27 17:53:31 2016 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 1bSR98-0002bN-HE for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2016 17:53:22 +0200 Original-Received: from localhost ([::1]:47049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSQcW-0003I1-D5 for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2016 11:19:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSQYT-0008D7-I5 for emacs-devel@gnu.org; Wed, 27 Jul 2016 11:15:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSQYN-00018O-Of for emacs-devel@gnu.org; Wed, 27 Jul 2016 11:15:28 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:43519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSQYN-00017w-FA for emacs-devel@gnu.org; Wed, 27 Jul 2016 11:15:23 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6RFFLKv024695 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Jul 2016 15:15:22 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u6RFFLDm027532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Jul 2016 15:15:21 GMT Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u6RFFJ5h021184; Wed, 27 Jul 2016 15:15:21 GMT In-Reply-To: <5798C59D.8000308@orcon.net.nz> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] 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.21 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" Xref: news.gmane.org gmane.emacs.devel:206184 Archived-At: FWIW - I would have no use for that, and I would find code that uses it harder to read than what I would normally write. In fact, I rarely use `prog1', `prog2', or `progn' - less than 0.1% of code lines for `prog1', .02% for `prog2', and 0.5% for `progn'. And all of the `prog2' lines, and some of the others, are only for code that mirrors some code distributed by Emacs (e.g., so that subsequent updates/diffs are easier). IOW, it's really someone else's ugly code. ;-) I use `prog1' for the swapping idiom (which might be clearer as a `swap-values' macro, but which is ingrained in me and easy to see): (setq start (prog1 end (setq end start))) and sometimes for a return-value computation that is followed by some side effect such as showing a message. But for most cases where someone else might use `prog1' I'm already let-binding a variable that I use for the value that might otherwise be returned by the `prog1' (or by a `prog2'). (let (... result) ... (setq result ...) ... result) And I rarely use `progn' with `if', preferring `when', `unless', `and', `or', or `cond' for most such use cases. Just one opinion.