is evaluation order defined, and evaluation of conditionals
Bob Sneidar
bobs at twft.com
Mon Jun 25 19:44:34 EDT 2012
I believe this was discussed in a thread long ago. To my knowledge, logical expressions are evaluated left to right. Mathematical expressions of course, follow the order of operations found here: http://en.wikipedia.org/wiki/Order_of_operations
I will be corrected if I am mistaken.
Bob
On Jun 25, 2012, at 4:17 PM, Dr. Hawkins wrote:
> Is the order in which expressions will be evaluated defined int LiveCode
>
> For example, if I have fields such as live_cats live_dogs and such,
> some but not others of which have corresponding fields dead_cat,
> dead_mouse, etc, can if have a construct that comes to
>
> switch
> case exists(dead_cat) and ("bad_smell" is among the words of dead_cat)
>
> If it is defined that the leftmost expression is evaluated first, and
> the right-hand only if needed to resolve the "and," I would expect
> this to work.
>
> If it doesn't, though, things get more difficult: using the exists()
> within the switch throws me down that path, and only down it can I
> check bad_smell.
>
> --
> The Hawkins Law Firm
> Richard E. Hawkins, Esq.
> (702) 508-8462
> HawkinsLawFirm at gmail.com
> 3025 S. Maryland Parkway
> Suite A
> Las Vegas, NV 89109
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list