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

Marius Storeide Kjelsvik shared this question 2 years ago

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)


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


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



Sorry, no.

© 2021 International GeoGebra Institute