[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: if vs. when vs. and: style question
From: |
Drew Adams |
Subject: |
RE: if vs. when vs. and: style question |
Date: |
Mon, 23 Mar 2015 17:34:20 -0700 (PDT) |
> (or (find-thingy-in-whatcha name)
> (find-thingy-in-macall name)
> (find-thingy-in-it name)
> (error "not found")))
...
> (and (valid-name-p name name)
> (exists-thingy-named name)
> (find-thing-or-create name)))
Yes, I do that too. It is a case where the behavior of each
piece matters (can matter), even if it might not be the case
that the return _value_ is used. It's about making use of the
behavior of `and' and `or'.
But I use `(unless a b)', not `(or a b)' if the code does not
use the resulting value and is thus just for the side effects
of `b'. Likewise, I use `(when a b)', not `(and a b)', if the
value is unimportant.
- if vs. when vs. and: style question, Marcin Borkowski, 2015/03/23
- RE: if vs. when vs. and: style question, Drew Adams, 2015/03/23
- Re: if vs. when vs. and: style question, Pascal J. Bourguignon, 2015/03/23
- RE: if vs. when vs. and: style question,
Drew Adams <=
- Message not available
- Re: if vs. when vs. and: style question, Emanuel Berg, 2015/03/23
- Re: if vs. when vs. and: style question, Rusi, 2015/03/24
- Re: if vs. when vs. and: style question, Emanuel Berg, 2015/03/24
- Re: if vs. when vs. and: style question, Pascal J. Bourguignon, 2015/03/24
- Re: if vs. when vs. and: style question, Emanuel Berg, 2015/03/24
- Re: if vs. when vs. and: style question, Rusi, 2015/03/24
- Re: if vs. when vs. and: style question, Pascal J. Bourguignon, 2015/03/25
- Re: if vs. when vs. and: style question, Rusi, 2015/03/25
- Re: if vs. when vs. and: style question, Stefan Monnier, 2015/03/25
- Re: if vs. when vs. and: style question now Unicode, Dan Espen, 2015/03/25