in reply to Complex conditional statements
What do "if" and "undef" mean? What's the relative precedence of "unless", "or" and "if"? If your snippet is equivalent to
if (not B) { A } else { if (E and F) { C and D } else { undef } }
it can be written as
(not B and A) or (B and ( ((E and F) and (C and D)) or (not (E and F) and undef) ))
and simplified (through logic arithmetic) to
(not B and A) or (B and E and F and C and D)
Notes:
For convertion to single expressions: if (A) { B } else { C } === (A and B) or (not A and C) For simplification: X and undef === undef X or undef === X
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Complex conditional statements
by bofh_of_oz (Hermit) on Jun 16, 2005 at 15:01 UTC | |
by ikegami (Patriarch) on Jun 16, 2005 at 15:12 UTC |