CS 61A

Structure and Interpretation of Computer Programs, Fall 2014

Instructor: John DeNero




Question | Llama Yak HOF

Draw the environment diagram for the following piece of code

def yak(zebra):
    return 20 // zebra
def llama(alpaca):
    zebra = 0
    def yak(zebra):
        return alpaca(zebra)
    return yak

>>> llama(yak)(4)