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 16:21:06 -0700 (PDT) Message-ID: References: <87o9btob5k.fsf@portable.galex-713.eu> <99393ed6-6947-4246-ad8e-b4984c776a53@default> <87zhvdldoh.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 1539731983 23588 195.159.176.226 (16 Oct 2018 23:19:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 23:19:43 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Garreau, Alexandre" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 17 01:19:39 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 1gCYck-00060T-RS for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Oct 2018 01:19:38 +0200 Original-Received: from localhost ([::1]:60558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCYer-0000ui-3B for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Oct 2018 19:21:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCYeN-0000uN-49 for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 19:21:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCYeJ-0006ex-2r for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 19:21:19 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:52612) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gCYeI-0006eQ-No for help-gnu-emacs@gnu.org; Tue, 16 Oct 2018 19:21:14 -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 w9GNIpSD087719; Tue, 16 Oct 2018 23:21:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=uNrumRQPOK8SUvhwJCCXg240DtOVK5/9jT5b0KTAEko=; b=Jkkp3qN20TxoJfb1jYMmtRekCTwWMQGQG570cFAcg01pKSmBSSXrD1FnD+uIF95sDcu/ iifl99IaV5DCCnsf9/eKudpOCMUhLqsohSuBqjKzw8YGqFPvLBwUAB2n3hIBlhcIpI8y 7DTxc7Yu/BeaCWGty+BZmB/x/+qSmS9EKYeMqsUQHa8N7z1sBAng+RbKrnDLRZL3Ofpn g5ly9vfzTgeb0V4O5Kg4r4zF7XYZ9+Q6qlVckAK4owFbr/LaklCZIolZi5/6l9rHqB7o 0D4iT1BnFvkGAgxLVWTlxuN1XXId3uX2732t7D6L+ZpS9u3NkrBiJjjtQqq460wZ0FAK IA== Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2n384u3y5n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 23:21:10 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9GNL78J004104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 23:21:09 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9GNL7Gr010527; Tue, 16 Oct 2018 23:21:07 GMT In-Reply-To: <87zhvdldoh.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=514 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810160195 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:118287 Archived-At: > Okay, so what about when you care about the result, but absolutely not > about the return value of the condition? >=20 > (unless cond body) vs (or cond body) -> `or' might imply you might want > to return cond. I don't understand the question. I use (or ...) when I want to return the value of a disjunction, where that value, if non-nil, might be any non-nil Lisp value. If (or cond body) returns cond then it's because cond is non-nil? What's the question? (And there is no "cond" as in condition versus "body" as in body. `or' just returns the first non-nil arg, or nil if none is non-nil.) > > 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). >=20 > So unless it is simple, you always write your big-conditions if as an > imbrication of both `or' and `and'? isn=E2=80=99t this actually less easy= to > understand (even if easier to read with indentation)? Dunno what you mean. Isn't what less easy to understand than what? What's a "big-condition"? I use `if' when the code cares about the return value, just like `or' and `and'. If the code doesn't care about the return value, and if there is only one condition, then I use `when' or `unless'.