From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: if-let and when-let: parallel or sequential Date: Mon, 11 Aug 2014 20:49:29 +0300 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="53e90229_4e6afb66_d691" X-Trace: ger.gmane.org 1407779390 28844 80.91.229.3 (11 Aug 2014 17:49:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2014 17:49:50 +0000 (UTC) Cc: John Mastro , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 11 19:49:43 2014 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 1XGtj4-0003MM-GB for ged-emacs-devel@m.gmane.org; Mon, 11 Aug 2014 19:49:42 +0200 Original-Received: from localhost ([::1]:37349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGtj4-00052B-4c for ged-emacs-devel@m.gmane.org; Mon, 11 Aug 2014 13:49:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGtiv-00051z-Q0 for emacs-devel@gnu.org; Mon, 11 Aug 2014 13:49:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGtiq-0003C9-9x for emacs-devel@gnu.org; Mon, 11 Aug 2014 13:49:33 -0400 Original-Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]:59503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGtip-0003Bw-VR for emacs-devel@gnu.org; Mon, 11 Aug 2014 13:49:28 -0400 Original-Received: by mail-wg0-f50.google.com with SMTP id n12so8987999wgh.9 for ; Mon, 11 Aug 2014 10:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=JaznRjGGcbN/QkM70PWy7AdE9YOUAlulHIQGlSQUeYw=; b=voUIuZLXeb4PTOUQh3FETForNKbySysQT3bPSX4wgqT44074KjJ7E2VbOSO+H9W12C UPqY48KRTDnLkrtsBBJxCz8RoxNQhKNnQ0WeqGJQuxJv9PkfOeiqZWgPHZWNuS7PFCLV EN3vZcrXZq/7MtHED1/BcC5iOg07nx0GqHzQDLAt+37qNaRE4zKZ2dN75gr9xCajhFbM 0TMBoyPZrJjgc6QVnM21rvttWpKqcQgaUrQrB9Hn2tSnysWHjvsKM/e92GCIlBdDaGDI 8TkKZy5w4xb7MTKbIaNQGGXyfuSFFju9DB8GtAe/XfMVrZZt55wPV6U42Sqj/iPE7pee C70g== X-Received: by 10.194.206.67 with SMTP id lm3mr57114384wjc.70.1407779367086; Mon, 11 Aug 2014 10:49:27 -0700 (PDT) Original-Received: from bozhidar-mini.local ([93.123.71.105]) by mx.google.com with ESMTPSA id jx10sm3245887wjc.7.2014.08.11.10.49.24 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 10:49:25 -0700 (PDT) In-Reply-To: X-Mailer: Airmail (247) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::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:173576 Archived-At: --53e90229_4e6afb66_d691 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On August 11, 2014 at 17:42:20, Stefan Monnier (monnier=40iro.umontreal.c= a) wrote: > if-let and when-let don=E2=80=99t make much sense with more than one bi= nding=C2=A0 > form.=C2=A0 Why do you think so=3F If they only work for a single binding, the=C2=A0 benefit is really minor. It's only when you use several bindings that=C2=A0= the benefit becomes more significant (the alternative being either=C2=A0 a very deeply nested code, or separating the var's declarations from=C2=A0= their initialization).=C2=A0 Stefan=C2=A0 Practically speaking, the most common case people run into is checking wh= ether a single object is nil=C2=A0 and binding it to some local if it=E2=80=99s not. Binding multiple locals= in such a form reduces the clarity of the code because the=C2=A0 semantics are not that clear anymore - should all the forms produce non-n= il or should only the first form produce non-nil=3F Obviously=C2=A0 people can (and should) read the documentation, but I=E2=80=99m a huge be= liever in intuitive APIs. That said, I=E2=80=99m fine with whatever=C2=A0= behavior you decide upon, as I believe those functions are valuable addit= ions regardless. --53e90229_4e6afb66_d691 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline