in reply to Re: parentheses around a function call in a ternary choice
in thread parentheses around a function call in a ternary choice

To be very honest, the warnings coming when using "warnings"

do not explain very much to me !

(which constants are we warned about ?)

But your explanations do explain all clearly!

Thanks to all

  • Comment on Re^2: parentheses around a function call in a ternary choice

Replies are listed 'Best First'.
Re^3: parentheses around a function call in a ternary choice
by FunkyMonk (Bishop) on Jun 23, 2009 at 21:40 UTC
    a successful print returns true (see print). So your prints are equivalent to

    1 ? "3: Flag is up\n" : "3: Flag is not up\n";

    and that's a constant expression that evaluates to

    "3: Flag is up\n";

    That's a constant that isn't used for anything -- a constant in void context.

    When you get errors or warnings you don't understand try adding use diagnostics;. It will try to explain the error or warning given.


    Unless I state otherwise, all my code runs with strict and warnings