Evaluation of easylanguage expressions  [SOLVED]

Questions about MultiCharts and user contributed studies.
Guest

Evaluation of easylanguage expressions

Postby Guest » 01 May 2007

hi
Does MC practice "short circuit" when evaluating conditional expressions ?

Example, i have a statement
IF Condition A and Condition B then ....

Is MC smart enough to say if Condition A is false.. then don't bother evaluating condition B since the whole statement would be false anyway.....

Or does it brute force.. evaluate both conditions then decide if the whole statement is true or false ?

thank you

Guest

Re: Evaluation of easylanguage expressions

Postby Guest » 03 May 2007

hi
Does MC practice "short circuit" when evaluating conditional expressions ?

Example, i have a statement
IF Condition A and Condition B then ....

Is MC smart enough to say if Condition A is false.. then don't bother evaluating condition B since the whole statement would be false anyway.....

Or does it brute force.. evaluate both conditions then decide if the whole statement is true or false ?

thank you
Does anyone in TSSupport have any idea how such easylanguage expressions are evaluated ?

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 04 May 2007

PowerLanguage is smart enough and won't evaluate the second condition if the first condition is false. But you should keep in mind that in TS EasyLanguage such conditional expressions are evaluated not from left to right as in many other languages including PowerLanguage but from right to left.

Guest

  [SOLVED]

Postby Guest » 04 May 2007

PowerLanguage is smart enough and won't evaluate the second condition if the first condition is false. But you should keep in mind that in TS EasyLanguage such conditional expressions are evaluated not from left to right as in many other languages including PowerLanguage but from right to left.
It is strange to evaluate from right to left....

So confirm for this statement
IF Condition A and Condition B then ....

It will evaluate Condition B first and if Condition B is false, it will not evaluate Condition A ?

thanks

Guest

Postby Guest » 04 May 2007

PowerLanguage is smart enough and won't evaluate the second condition if the first condition is false. But you should keep in mind that in TS EasyLanguage such conditional expressions are evaluated not from left to right as in many other languages including PowerLanguage but from right to left.
Are you saying:
TS Easylanguage evaluate from right to left whilst
MC Powerlanguage evaluate from left to right ?

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 04 May 2007

Yes, correct. PowerLanguage evaluate conditional expressions from left to right. EasyLanguage evaluate them from right to left.

fcogneaux
Posts: 2
Joined: 23 Jan 2018

Re: Evaluation of easylanguage expressions

Postby fcogneaux » 18 Nov 2022

For those who may be interested 16 years later; I have just made the test : it's no longer the case, both languages evaluate from left to right (and both short-circuit)...


Return to “MultiCharts”