This week's worksheet👇
mentor11.pdf
mentor11_sol.pdf
Scheme concept review
Useful links:
https://cs61a.org/articles/scheme-builtins/
https://cs61a.org/articles/scheme-spec/
Primitives
- Primitives evaluate to themselves.
- scm> True → True
- scm> 3 → 3
Call expressions *prefix notation in scheme
Form: (operator operand operand)
- Evaluate operator and operands from left to right
- Apply operator value on operand values
Special forms: define variables
- looks like a call expression
- don't evaluate the first operand (the variable)
- evaluates to the variable name
scm> (define x 5)
x
scm> (define y (+ x 4)