I've always heard this called "short-circuit" boolean evaluation.

It was present in C (and Turbo Pascal), and basically allows conditions
such as:

      char *p = somefunc();  /* returns pointer or NULL */
      if (p && p->foo) /* short-circuit will fall through if p is NULL
before dereferencing p */

Without short-circuiting, this would have to be rewritten
      if (p)
        if (p->foo)

to avoid possible SIGSEGV.

As Henry Spencer's 2nd Commandment for C programmers clearly advises:
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end."

-blair



____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to