[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: code review request for saveplace with dired buffer
From: |
Drew Adams |
Subject: |
RE: code review request for saveplace with dired buffer |
Date: |
Fri, 7 Jun 2013 13:08:05 -0700 (PDT) |
> > There might be a convention of using `when' instead of `if', when
> > there's no possibility of an `else' clause. (I'm not sure about that,
> > though, so if someone else is I hope they'll speak up.)
>
> I'm not aware of a convention. Personally I prefer (if foo) rather than
> (when foo) if `foo' is a single item, but since (when foo) ==
> (if (progn foo)), and the compiler optimizes away the useless progn, it
> makes no difference in practice.
A Common Lisp convention is to use `when' and `unless' when the return value is
not important. It communicates to a (human) reader that the body is for side
effects only.
I, for one, use this same convention with Emacs Lisp. I consider code that
depends on the return value of `when' or `unless' to be bad style (misleading).
Some will disagree, no doubt.