On 11/10/2010 09:41 AM, Erik Christiansen wrote:
> On Wed, Nov 10, 2010 at 09:15:34AM -0500, Mark Wendt wrote:
>    
>>>
>>>        
>> But, depending on the operator, either&&  or ||, the entire expression
>> is evaluated differently.  If the conditional operator is&&, then the
>> second condition is evaluated if, and only if, the first returns true.
>> If it returns false, the second expression is never evaluated.  On the
>> other hand, if the short circuit operator is || then both expressions
>> will always be evaulated.
>>      
> No, sorry, that is simply the De Morgan equivalent of the first case, so
> complete evaluation is necessitated on the opposite state of the first
> term of the expression. i.e.
>
>     0 || A = A     # Must check A.
>     1 || A = 1     # So why check A?
>
> In neither case is it necessary to evaluate the full expression when the
> first term has already determined the result.
>
> Erik
Erik,

   Yes, you are right on that.  I forgot to include the second condition 
when I was typing and and didn't consider.  I should have said that if 
the operator is || and the first expression is false, then it will 
always evaluate the second expression.

Mark

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to