Compilation Methods SS 2009 - Slide 315
Objectives:
Understand loop code
In the lecture:
- Explain the code sequences for while-loops.
- Discuss the two variants.
- Explain the code sequences for for-loops.
- Variant 1 may cause an exception if Final evaluates to maxint.
- Variant 2 avoids that problem.
- Variant 2 needs further checks to avoid an exception if Init evaluates to minint.
- Both variants should not evaluate the Final expression on every iteration.
Questions:
- What are the advantages or problems of each alternative?
©2009 Prof. Dr. Uwe Kastens
Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 30.03.2009