help-gnu-emacs
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]