Lab 12 - Macros
Instructions: https://inst.eecs.berkeley.edu/~cs61a/su19/lab/lab12/#required-problems
Solution: https://github.com/tomthestrom/cs61a/blob/master/lab/lab12/lab12.scm
The first 2 questions are non-coding - What Would Scheme Do?
Q3: Repeatedly Cube
Implement the following function, which cubes the given value x
some number n
times, based on the given skeleton.
Q3: Solution
Q4: Scheme def
Implement def
, which simulates a python def
statement, allowing you to write code like (def f(x y) (+ x y))
.
The above expression should create a function with parameters x
and y
, and body (+ x y)
, then bind it to the name f
in the current frame.
Q4: Solution
Last updated