|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> >
> > So is a string expression the only kind of 'thing' that #ifdef sees
> > as defined?
> > Nope. Even an arbitrary float value behaves the same way:
> >
> > #ifdef(7.6)
> > ...do this... // success
> > #else
> > ...do that...
> > #end
> >
> This is the way POV-Ray works with "Boolean" values (and IIRC, so do other
> computer languages) O is false, and any non-zero value is true.
> Send the str value of true to debug and see what it is. It's a
> common shorthand to use 0 and 1 for t&f or the setting of "flags" in code.
Yep, I get that-- if the #ifdef is seeing it as boolean, that is. But here's a
weird thing (well, weird to me at this point of my fuzzy understanding):
#ifdef(true)
is apparently seen as NOT defined, and falls through to the #else. Of course,
I'm not even sure if that construct makes any sense code-wise or syntax-wise.
>
>
> (And to head off your purely theoretical complaint, 7.6 IS a number, and so it
> IS defined when that ) closes the #ifdef statement.
> You might try that with 0 and see what happens...
Strangely(?), this has the same result as above: #ifdef(0) falls through to the
first clause. So maybe the 'boolean' explanation doesn't hold for #ifdef?
Post a reply to this message
|
 |