ExpressionEvaluator icon indicating copy to clipboard operation
ExpressionEvaluator copied to clipboard

&& || operator not short-circuit as C# did

Open PingMyCat opened this issue 4 years ago • 2 comments

x = 100; if( false && (x=50) > 100 ) return 0; return x; // --------------------------// x = 100; if( true || (x=50) < 0 ) return x; return 0;

the right part of "&&" "||" are still evaluated

PingMyCat avatar Aug 17 '21 06:08 PingMyCat

Hello @PingMyCat. Thanks to reporting this issue and sorry for my late response. I will look what I can do for this but it' looks tricky as it is link to issues #56 and #81. So I don't know if it's possible to correct this bug without breaking others corrections.

I am also currently investigating the possibility to compile to expression tree. see(#58). If I manage to make it work it should manage automatically this kind of issues. The drawdown is that it's a big rewrite of ExpressionEvaluator so it take time, and a lot of functionalities that are based on the on the fly evaluation and duck typing need to be rewrite and/or manage/call differently.

codingseb avatar Aug 25 '21 05:08 codingseb

Your work is amazing. It's the best embedded script solution I found. Wish to see 2.0 soon. My project depend on the "on the fly" feature. Wish you can make it more.

Best reguards,

SnowCat [<Time is ocean in the storm>]

在 2021年8月25日,13:56,Coding Seb @.***> 写道:



Hello @PingMyCathttps://github.com/PingMyCat. Thanks to reporting this issue and sorry for my late response. I will look what I can do for this but it' looks tricky as it is link to issues #56https://github.com/codingseb/ExpressionEvaluator/issues/56 and #81https://github.com/codingseb/ExpressionEvaluator/issues/81. So I don't know if it's possible to correct this bug without breaking others corrections.

I am also currently investigating the possibility to compile to expression tree. see(#58https://github.com/codingseb/ExpressionEvaluator/issues/58). If I manage to make it work it should manage automatically this kind of issues. The drawdown is that it's a big rewrite of ExpressionEvaluator so it take time, and a lot of functionalities that are based on the on the fly evaluation and duck typing need to be rewrite and/or manage/call differently.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/codingseb/ExpressionEvaluator/issues/114#issuecomment-905205330, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVHQIYZ4SH6XS2ZBXZSYFODT6SAYDANCNFSM5CJFJJ4A. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

PingMyCat avatar Aug 25 '21 06:08 PingMyCat