Re: [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..."

Subject: Re: [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..."

Date: Sat, 14 Jan 2012 10:52:27 +0100

To: David Edmondson, Jani Nikula

Cc: Notmuch Mail

From: Pieter Praet


On Sat, 14 Jan 2012 10:14:57 +0100, Pieter Praet <pieter@praet.org> wrote:
> On Fri, 13 Jan 2012 08:23:55 +0000, David Edmondson <dme@dme.org> wrote:
> > On Thu, 12 Jan 2012 18:33:06 +0100, Pieter Praet <pieter@praet.org> wrote:
> > > Less code, same results, without sacrificing readability.
> > 
> > +1, but why not replace non-branching `if' with `when' as well?
> 
> I was planning to do that when the `unless' patch was accepted,
                    ^^
                   submit

> but after reading Xavier and Tomi's replies, I've changed my mind.
                                               ^^^^^^^^^^^^^^^^^^^^
                                               I hadn't, though...

> 
> Looking at "subr.el", it's actually more efficient to use `if'
> (implemented in C) instead of `when' (a macro, which essentially
> runs "if conf (progn ...)".
> 
> The amount of non-branching "(if COND (progn ..."  statements is very
> limited though, so if inclined to "fix" them nonetheless, a patch
> follows (relative to the previous one!).
> 
> 
> Peace
> 
> -- 
> Pieter

Typsos FTW!

-- 
Pieter

Thread: