Eager vs lazy GeoGebra-skript operators 'and' and 'or'

Marius Storeide Kjelsvik shared this question 8 months ago
Answered

From what I can see, the '&&' (and '/\') in GeoGebra-scripts appear to be implemented as 'eager' (both sides of the expressions are evaluated before the 'and' statement is evaluated). If this is correct, is there a lazy 'and'-operator available? I have a suspicion that the 'and'-statements are the main reason the GeoGebra-objects I'm working with are loading relatively slowly.


Similarly, I'm in need of a lazy 'or'-operator.

Comments (3)

photo
1

Sorry, no. If you post your file we may be able to help

photo
1

The question is if you can make GGB skip a calculation. If you have a boolean:

a==1 && b==bigCalculation

And a = 2, then it is not necessary to make the bigCalculation.

Is it possible to make it:

If(a==1, b==bigCalculation, false)

will geogebra then skip the bigCalculation if a=2? Or any other way to skip this calculation

?

photo
1

Sorry, no.

© 2019 International GeoGebra Institute