Re: [dwm] no () around ISTILE

From: David Tweed <david.tweed_AT_gmail.com>
Date: Tue, 25 Sep 2007 22:51:09 +0100

On 9/25/07, Jesus Galan <yiyu.jgl_AT_gmail.com> wrote:
> On Tue, Sep 25, 2007 at 09:29:36PM +0200, Szabolcs Nagy wrote:
> > #define ISTILE isarrange(tile) /* || isarrange(<custom>) */
> >
> > can be misleading with custom layouts since in zoom() it is used like
> >
> > if(.. !ISTILED ..) return;
> >
> > so either there should be a comment about parenthesis in config.def.h
> > or zoom should use it like 'if(.. !(ISTILED) ..)'
>
> I see your point, but I think it is implicit that you should use
> parenthesis in complex expressions, in the same way that you have
> to use quotation marks in strings, for example (IMVHO).

I don't think that's the prevailing view but rather "if a macro has
been made to look like a variable, then it should be safe to use it as
you would a normal variable", particularly since misuse is unlikely to
lead to a compilation error but rather silent wrong code (as
happened).

-- 
cheers, dave tweed__________________________
david.tweed_AT_gmail.com
Rm 124, School of Systems Engineering, University of Reading.
"we had no idea that when we added templates we were adding a Turing-
complete compile-time language." -- C++ standardisation committee
Received on Tue Sep 25 2007 - 23:51:12 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:55:41 UTC