From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: Anaphoric macros: increase visibility Date: Sat, 14 Jan 2017 04:13:20 +0000 Message-ID: References: <87wpdyivvf.fsf@web.de> <87k29y2x1g.fsf@pointsman.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1484367250 22426 195.159.176.226 (14 Jan 2017 04:14:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Jan 2017 04:14:10 +0000 (UTC) Cc: Rolf Ade , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 14 05:14:06 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSFj2-0004Y1-Ha for ged-emacs-devel@m.gmane.org; Sat, 14 Jan 2017 05:13:56 +0100 Original-Received: from localhost ([::1]:46376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSFj6-0008WP-S7 for ged-emacs-devel@m.gmane.org; Fri, 13 Jan 2017 23:14:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSFj0-0008WJ-5i for emacs-devel@gnu.org; Fri, 13 Jan 2017 23:13:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSFiy-0005b6-Q1 for emacs-devel@gnu.org; Fri, 13 Jan 2017 23:13:54 -0500 Original-Received: from mail-ua0-x22b.google.com ([2607:f8b0:400c:c08::22b]:35411) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSFiy-0005ag-Kf for emacs-devel@gnu.org; Fri, 13 Jan 2017 23:13:52 -0500 Original-Received: by mail-ua0-x22b.google.com with SMTP id y9so50482584uae.2 for ; Fri, 13 Jan 2017 20:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=C8ZFkSF8UjSsLs+Ij5gnzzmkya1z5SXlUGxqjBRhcHo=; b=f9/RplKpnODBRxUC1EF6nxzeD3ZcP30NnisFvpdZspkiYMNLRNLOmKimEz9zprnbTU 0q6KlDYNiBOhlCmLg5AMZWJpPgwCH6QwOxPtXBby7PP3UotalbbV/I4rCcyXq8/Ei3r9 opUEAwjNnTOYj5tNASvBXniYmdbr4mWORDO+riODOOHj8CECGhYRLzGcsKpQ2umLUJ8P 7zeFBKldalK/6OO/rlAsxeA3//UnVt7AO03W9nbgzyLy77Z6AWKlhprm38XpKUD77cbT gPu/agmzy24W6lbtCuYg0oSqWSb89DoDd0C2xTGewLtI+bWbS8dswmImfShlZIqZTByN ArxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=C8ZFkSF8UjSsLs+Ij5gnzzmkya1z5SXlUGxqjBRhcHo=; b=WWLoJzSxz2OKy7xr0PNfUOVw50HyzF8GGDS2gB/mVPLEjw5VIaaGkuhDo9B2RGDZoR oROWbopfVBaiBSpD46c5EB7f+n9Oy3rYbKsiEXkj8HuNMuUcPkTQFBBaCUDLhPLDqxcN e+sthvNOsopRYtpBrSfXCIKVslbtznPAqQ8tgeXHjY/phO2TG5YNP3exJ1ZKOjKnADTa a6FXAx/xdfIfJeZAJAFTTsOmnC7m7t4U3pmxbaQ50xrco59RnT2BfWode0oYcchw2qWg 8WCqubirNQDR3DMUHpxRDn9o0wZCqGymOeWS1YhwgGXmGtK/qj8R2PwR5v3L9IHHDCQi 3vNg== X-Gm-Message-State: AIkVDXK3Mya25eNvNKl6wvDyN7ETUwdvQ94tvSnqq4ywGJ01l2aZ7QScjePggxFdQ2MAHJHc6dtyM+IzrAoAFA== X-Received: by 10.176.81.124 with SMTP id f57mr11971180uaa.18.1484367230592; Fri, 13 Jan 2017 20:13:50 -0800 (PST) Original-Received: by 10.176.71.22 with HTTP; Fri, 13 Jan 2017 20:13:20 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::22b 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:211261 Archived-At: On 14 January 2017 at 03:03, Noam Postavsky wrote: > On Fri, Jan 13, 2017 at 9:30 PM, Rolf Ade wrote: >> >> Michael Heerdegen writes: >>> We also already have `if-let' and `when-let' in "subr-x". They are like >>> `aif' and `awhen' but you specify "it" explicitly. >> >> Since you mention them ... I probably miss something obvious but from >> looking at the documentation of if-let >> >> (if-let BINDINGS THEN &rest ELSE) >> >> and of when-let >> >> (when-let BINDINGS &rest BODY) >> >> I don't get, why there is a need for when-let? >> > > Just like there is both `if' and `when', it's useful to have both > `if-let' and `when-let'. > Rolf, `when' and `when-let' are macros that expand to the corresponding `if' form without an ELSE, so strictly the `when' forms are redundant, as you suggest. But they make the code easier and quicker to read (and feel a little more natural to write), because you know the ELSE is null without having to think about it. Finding the ELSE (if any) of an `if' form can be quite a pain. The unusual indentation of the THEN clause exists for the same reason, but it's a bit ugly, which is a second (maybe less important) motivation for `when'.