DatMCEyeBall Posted January 10, 2014 Share Posted January 10, 2014 AutoIt is known by its lazy evaluation strategy, so no that's never the case. You misunderstood me if you assume something like that. ? "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
trancexx Posted January 10, 2014 Share Posted January 10, 2014 It means you won't see messagebox in this example: $x = 0 And MsgBox(0, "", "Google next time first") ConsoleWrite($x & @CRLF) But you will see it here: $x = 1 And MsgBox(0, "", "Google next time first") ConsoleWrite($x & @CRLF) ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
DatMCEyeBall Posted January 10, 2014 Share Posted January 10, 2014 That's not "lazy", at least I don't think it's "lazy". $x = 0 evaluates to false, and since in an And statement all the expressions need to be true, it skips over and continues. "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 11, 2014 Share Posted January 11, 2014 You're the one who claimed that "$a" would be evaluated twice in your example. Link to comment Share on other sites More sharing options...
trancexx Posted January 11, 2014 Share Posted January 11, 2014 Aha, I see your point now. Only your cache remark doesn't make sense because $a should be evaluated twice when expression is written like that - by definition. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 11, 2014 Share Posted January 11, 2014 I intended it to be more of a: cache your results and don't call functions repeatedly for the same result. Link to comment Share on other sites More sharing options...
trancexx Posted January 11, 2014 Share Posted January 11, 2014 (edited) But it's not possible to know the result in advance. Not even for simple (non-const) variable. For other more usual cases:$x = a() ? a() : 2 Func a() Return Random(0, 1000) EndFuncYou would cahce the return value of function "a" there? Edited January 11, 2014 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
DatMCEyeBall Posted January 11, 2014 Share Posted January 11, 2014 $y = a() $x = $y ? $y : 2 Func a() Return Random(0, 1000) EndFunc "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 12, 2014 Share Posted January 12, 2014 (edited) But it's not possible to know the result in advance. Not even for simple (non-const) variable. For other more usual cases:You would cahce the return value of function "a" there?$y = a() $x = $y ? $y : 2 Func a() Return Random(0, 1000) EndFunc^ ThisThis is a situation where you should cache your results in any programming language and situation. Edited January 12, 2014 by Richard Robertson Link to comment Share on other sites More sharing options...
trancexx Posted January 12, 2014 Share Posted January 12, 2014 I think you're just pulling my leg. DatMCEyeBall 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now