Title: [jdjlist] Re: In Java is this a valid expression (if( n <\<> 0 ) )

Ok, guys, I, like, get it. I should have looked up the "correct term definition".
I have sinned and I sincerely repent!!
hehehehe

The MAIN point I was making still stands:
 (if( n <\<> 0 ) )
is
 (if( n < 0) )

Greg


-----Original Message-----
From: Blair Wyman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 27, 2002 8:53 AM
To: JDJList
Subject: [jdjlist] Re: In Java is this a valid expression (if( n <\<> 0
) )



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
____________________________________________________

____________________________________________________
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