Mutation
We follow the section on Mutation section from the Tolk repo.
Terminology
parameter passing in C
- Call by value: one way
- Call by reference: two way
- Call by name: pass the syntax, not the value
Eager/Lazy
- A function is strict if it evaluates its arguments before applying the function.
- A function is lazy if it does not evaluates its arguments before applying the function.
- A function may be strict in some arguments and lazy in others.
- The Haskell programming langauge is lazy by default; functions only evaluate their arguments when needed.
Functional/imperative
- Functional
- composition of pure functions, minimize and isolate side-effects, easy to reason about.
- Imperative
- instructions, commands, statements, changing program state, harder to reason about.
Mock Exam 2
Assignment
- Assignment 4 on interpreters