Asfianda / agk

Automatically exported from code.google.com/p/agk
0 stars 0 forks source link

Request: short circuit evaluation #434

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. if GetVirtualButtonExists(1) and GetVirtualButtonPressed(1) then..
2.
3.

What is the expected output? What do you see instead?

all are evaluated and of course if not exists, then get error

What version of the product are you using? On what operating system?

108

Please provide any additional information below.

In any boolean comparision, shortcircuit the result when it is already known 
(e.g. first condition fails, don't bother testing the rest)

Original issue reported on code.google.com by r...@norrish.force9.co.uk on 6 Nov 2012 at 12:41

GoogleCodeExporter commented 8 years ago
I am not sure why should it test the rest of conditions, while you use -and- 
operator there. Could your describe your problem further?

Original comment by kamac2...@gmail.com on 17 Nov 2012 at 11:24

GoogleCodeExporter commented 8 years ago
Kamac, you have misread the issue report.

I quote:
"In any boolean comparision, shortcircuit the result when it is already known.
[In case of the AND operator, if the] first condition fails, don't bother 
testing the rest."

Currently - AGK doesn't use shortcircuit evaluation. But it should...

Cheers.

Original comment by agentsam...@gmail.com on 20 Nov 2012 at 11:54

GoogleCodeExporter commented 8 years ago

Original comment by P.S.John...@gmail.com on 31 Jan 2013 at 6:26

GoogleCodeExporter commented 8 years ago
Finally!! I've wanted this feature in DBPro for years and to get in AGK in 
brilliant! :D

Original comment by clon...@yahoo.com.au on 31 Jan 2013 at 10:50

GoogleCodeExporter commented 8 years ago
Finally!! I've wanted this feature in DBPro for years and to get in AGK is 
brilliant! :D

Original comment by clon...@yahoo.com.au on 31 Jan 2013 at 10:50