Re: Logical expressions ("and" and "or")
Re: Logical expressions ("and" and "or")
- Subject: Re: Logical expressions ("and" and "or")
- From: Andrew Oliver <email@hidden>
- Date: Sun, 23 Feb 2003 14:26:16 -0800
Yes, it is also true in AppleScript.
According to
http://developer.apple.com/techpubs/macosx/Carbon/interapplicationcomm/Apple
Script/AppleScriptLangGuide/index.html :
>
When evaluating expressions containing the And operator, AppleScript checks
>
the leftmost operand first. If its value is false , AppleScript does not
>
evaluate the rightmost operand, because it already knows the expression is
>
false . (This behavior is sometimes called short-circuiting.)
The same is true (no pun intended) for other operators, as appropriate.
Andrew
:)
On 2/23/03 1:56 PM, "Jeffrey Mattox" <email@hidden> wrote:
>
A significant feature of the C language is that logical expressions
>
connected by && ("and") and || ("or") are evaluated left to right,
>
and evaluation stops as soon as the truth or falsehood of the result
>
is known [K&R, section 2.6].
>
>
Is this also true in AppleScript? If so, conditionals can be
>
optimized, a little.
>
>
Jeff
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.