CS 3304: Comparative Languages
Arithmetic Expressions
[
Course Documents
] : [
Arithmetic Expressions
]
Previous
Contents
Next
Keyword Index
Solutions for Side Effects
Two Possible Solutions to the Problem:
1. Write the language definition to disallow functional side effects
No two-way parameters in functions
No non-local references in functions
Advantage: it works!
Disadvantage: Programmers want the flexibility of two-way parameters (what about C?) and non-local references
2. Write the language definition to demand that operand evaluation order be fixed
Disadvantage: limits some compiler optimizations