(Unbound variable) Use functions on a list of S-Expressions (mit-scheme)

125 views Asked by At

I am trying to use a function on a list of S-expressions, but it just gives me an error "Unbound variable butter".

(depth* (()
         ((bitter butter)
          (makes)
          (butter bitter)
         butter)))
1

There are 1 answers

0
Óscar López On BEST ANSWER

It appears that you forgot to quote the s-expression, try this:

(depth* '(() ; notice the quote at the start of the list
          ((bitter butter)
           (makes)
           (butter bitter)
           butter)))