From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: if vs. when vs. and: style question Date: Mon, 23 Mar 2015 23:53:02 +0100 Message-ID: <87sicvwckx.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1427151214 5138 80.91.229.3 (23 Mar 2015 22:53:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Mar 2015 22:53:34 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 23 23:53:27 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1YaBDq-00086P-0D for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Mar 2015 23:53:26 +0100 Original-Received: from localhost ([::1]:58341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaBDp-00050x-DZ for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Mar 2015 18:53:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaBDe-00050e-1e for help-gnu-emacs@gnu.org; Mon, 23 Mar 2015 18:53:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaBDa-0005Ga-Pl for help-gnu-emacs@gnu.org; Mon, 23 Mar 2015 18:53:13 -0400 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:55526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaBDa-0005GO-J3 for help-gnu-emacs@gnu.org; Mon, 23 Mar 2015 18:53:10 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 54E8B5AEA7 for ; Mon, 23 Mar 2015 23:53:07 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G8v5B+N6Grsm for ; Mon, 23 Mar 2015 23:53:07 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 128965AE9C for ; Mon, 23 Mar 2015 23:53:07 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103273 Archived-At: Hi there, assuming (e1) and (e2) are some expressions, all three forms: (if (e1) (e2)) (when (e1) (e2)) (and (e1) (e2)) are semantically equivalent. Which one is better style (and when)? I would guess that =3Dwhen=3D is better iff (e2) is a =3Dprogn=3D (since = we can drop the =3Dprogn=3D altogether, and this seems to be the point of =3Dwhe= n=3D), and =3Dand=3D might be considered better (well, maybe) by some people whe= n both (e1) and (e2) are very short (though I personally would avoid that, since =3Dif=3D seems easier for a human to understand at a first glance). Am I right? Notice: by =E2=80=9Cbetter=E2=80=9D I mean =E2=80=9Cmore idiomatic=E2=80=9D= , or =E2=80=9Ceasier/faster to read for a human=E2=80=9D, or =E2=80=9Cmore likely to be used by an experience= d Elisp hacker=E2=80=9D, etc. Regards, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University