From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: `when' vs. `and' / `unless' vs `or' Date: Tue, 16 Oct 2018 15:13:16 -0700 (PDT) Message-ID: <99393ed6-6947-4246-ad8e-b4984c776a53@default> References: <87o9btob5k.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1539727920 10707 195.159.176.226 (16 Oct 2018 22:12:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 22:12:00 +0000 (UTC) To: "Garreau, Alexandre" , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 17 00:11:56 2018 Return-path: Envelope-to: geh-help-gnu-emacs@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 1gCXZC-0002hV-5A for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Oct 2018 00:11:54 +0200 Original-Received: from localhost ([::1]:60356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCXbI-00072R-FH for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2018 18:14:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCXak-00071I-KN for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 18:13:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCXaf-0007mj-MF for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 18:13:30 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:51472) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCXaf-0007lY-Di for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 18:13:25 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9GMDI0V041548; Tue, 16 Oct 2018 22:13:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=LAnWsw9QlUcPIyPLk6n/QcBpv09HwBi9s5xD6IqhSJc=; b=XbeVrUuy8GBUdkVlMBQljDEv2z5ishCKITd6/QFt0j5QRr82M9FrAk1kthcZJ+B/LOVo 9Sapt+lBVLWAAUy1hrZ8N1xfMICX6XDd0M+NIlcVHB5nOljsXK97eM3LuX9R/2J0gpg0 cOMW5/MHWhyFPVuSd4+m3g3SDQ3CTeSyj7ooZXdJdyI2H+s62a4BNalfW2qTdfMKCAik 32J/YGZYNhw3ki86tFgcmwcmHLWrO4NdEm4rpJ+BPsZLnBuZp7z1ENKYgMsF9ygws1NV ubnni8SiyzkoBvqwlTfR6lvLnnwmDduAp9h9ASb9xX+50u0GeJxlOe/qIwKaZWRYYAoO Rg== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2n384u3s05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 22:13:18 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9GMDHAH008099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 22:13:18 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9GMDHwP029174; Tue, 16 Oct 2018 22:13:17 GMT In-Reply-To: <87o9btob5k.fsf@portable.galex-713.eu> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9048 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=587 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810160185 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:118285 Archived-At: Do whatever you like. ;-) Different people use different styles. There is no standard or even a convention. Common Lisp suggests some conventions, but there too there is nothing official. I use `when' and `unless' when I want to show a human reader (mainly me) that the code doesn't use or care about the return value. I don't use them when the returned `nil' could be important. I use `and' or `or' when the return value is significant. (With `not' as needed.) I use `if' when the true part is a single sexp. If necessary, to respect this I flip the true and false parts (negating the condition). I use `cond' when I have two or more sexps for each of the true and false parts or I have more than two conditions. I use `case' when the conditions would just test the same symbol for equality against different values. I don't use `pcase' much. Nothing against it, really. Yes, the way I use `if' etc. can mean that I change which form I use as the code evolves. I'd rather spend more time fiddling with the code, in order to have the result be easier to understand (for a human). YMMV.