PPL Chapter 5
PPL Chapter 5
Block Structure:
Programs are divided into blocks with their own scope.
Example:
Dynamic Scope:
Call by Value-Result:
A copy is passed, but changes are written back.
Example:
Call by Name:
Re-evaluates the argument each time it’s used.
Example (conceptually similar to lazy evaluation in functional programming).
Solutions:
o Mutexes
o Semaphores
o Atomic operations
8. Storage Management
Program-Controlled Storage:
Manually handled by programmers.
Example: malloc and free in C.
Static Storage:
Pre-allocated.
Example:
Stack-Based Storage: