is evaluation order defined, and evaluation of conditionals

Dr. Hawkins dochawk at gmail.com
Mon Jun 25 23:45:59 EDT 2012


On Monday, June 25, 2012, wrote:
>
> The case specifies a boolean "and". The order is unimportant in this
> example. If either argument is false, the case is ignored. It would not
> matter which was written first. The same would be true for a boolean "or,
> in that the order is not pertinent.


If the exists() fails, the comparison on the field that doesn't exist
should throw an error if evaluated--that's where my concern is.

Can you restate your problem? Or are you just exploring the language?
>

I have groups of fields on cards.  In some cases, auxiliary fields will
exist with a related name (a prefix change).  If that field both exists and
meets certain cipriteria, I want to do something with it.  If it exists but
doesn't meet the condition, I may want to do something in another branch of
my switch.
>
> In this particular case, I dodged the issue because of the pattern (all
auxiliary fields in the group exist), but it's likely to come up again a
couple of times.

In Fortran, it would be possible for either to be evaluated first, with
second not being checked if the first failed, or for both to be checked
even though both were false (I think the result is the same in C, but I'm
not sure)

Here, if the first is checked and failed, if this is used to fail the AND,
the needn't be evaluated, as it won't affect the outcome (this is actually
what I'd expect from a sophisticated interpreted language).



-- 
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



More information about the use-livecode mailing list