Hi,
I'm working on ex 3.40 but can't following the suggestion in exercise:
First I changed the representation of `senv` to make it keep track of whether it was bound by `letrec` or not (by tying every var with an extra bool value).
Then in `(var-exp (var)` of `translation-of`, I look at that bool value and translate `var-exp` into either `nameless-var-exp` or `nameless-letrec-var-exp`.
But soon as I start working to make the interpreter work, I realized I couldn't do the right things when dealing with `nameless-letrec-var-exp` but keep rest of the program intact,
because as the `value-of` reaches a nameless-letrec-exp, the environment doesn't contain the procedure we needed inside.
I can implement `letrec` by allowing the nameless-environment to store vectors to break the env-proc cycle dependency, but just don't follow the instructions in book.
Thanks.