bug-autogen
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-autogen] DEFINE and IF


From: David Taylor
Subject: Re: [Bug-autogen] DEFINE and IF
Date: Wed, 24 May 2006 15:07:46 -0400

> Date: Wed, 24 May 2006 11:38:48 -0700
> From: "Bruce Korb" <address@hidden>
> 
> Hi David,
> 
> This is true for all versions for all time.  It is a weakness in my doc.
> DEFINE/ENDDEF blocks get pulled out and put into a mini-template
> that gets invoked when the DEFINE-d name gets invoked.  Since
> this is done when the template is parsed (before processing), you
> cannot select a DEFINE in this way.  This will work:

So, it's intentional?  Yuck.  Sounds then like it's a doc bug then.
Since the handling of:

[+ IF expression +]
    [+ DEFINE .... +]
[+ ELSE +]
    [+ DEFINE .... +]
[+ ENDIF +]

violates the principle (so to speak) of least surprise, it should be
documented.

> [=3D INCLUDE (file-selection-expression) =3D]

I didn't think of using an expression to select the file.
After the above failed to work, I ended up doing:

[+ IF expression +]
    [+ INCLUDE some-file +]
[+ ELSE +]
    [+ DEFINE a-different-file +]
[+ ENDIF +]

But, that feels like (and, to be honest *IS*) a kludge.

And it makes the code harder to understand because now you need to
refer to another file to see the 3 lines that are there.

Changing the macro was/is cleaner than the alternative of copying
roughly 1000 lines and changing them to use a different macro and
introducing logic to select which version gets output into the
generated makefile fragment.

> and within that file have different DEFINEs for the same name.
> That will incorporate the DEFINE macro at instantiation (processing)
> time.  I will add some clarification on how DEFINE works.

Thanks.

> (BTW, any DEFINEs in *that* file will be pulled out before processing
> that file also.)
> 
> Thank you.
> 
> Also, I confess to never having moved my bug database from
> SourceForge.  There are not many and I try to keep up.

Ah, I didn't know that it used to live on SourceForge.  I try to check
bug databases before reporting problems to see if the problem has been
reported before.  That way, if it's known -- whether as a bug, as a
known limitation, or an intentional feature, I don't waste people's
time.

> Regards, Bruce

Thanks.

Later,

David




reply via email to

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