[Proposal]: if
maximum execution times. For ex.: if ( a == b, 1){...}
#9516
Unanswered
ichensky
asked this question in
Language Ideas
Replies: 1 comment 1 reply
-
IMO, the explicit code to manage that state and execution is substantially clearer than trying to bake it into the language, plus would be much more flexible. Having |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Often in loops, an
if
statement only needs to execute once or several times and then isn't necessary anymore.When functions are executed within
if
statements, they are sometimes optimized to load result from a cache, and sometimes not.Example.
It would be great to have an optional parameter within an
if
call that specifies thatif
body should be executed a maximum ofmaxCount
times and thenif
should be ignored or removed from the function code at runtime.Example 1
Which should work similarly to the code.
Example 2
Which should work similarly to the code.
Often people are lazy to write code with caching or just don’t want to clutter up the code with such flags.
Beta Was this translation helpful? Give feedback.
All reactions