Exercise 3.9

The recursive version:


Image links to original size picture

The iterative version:


Image links to original size picture

Advertisements

2 thoughts on “Exercise 3.9

  1. Hi there,
    I’m was glad to stumble on your elegant solution to exercise 3.9. However, I am a little concerned with the iterative factorial version. I understand that fact-iter is defined in the body of the factorial procedure; why then is fact-iter pointing to the global environment as it’s parent environment?

  2. In my (2nd) edition fact-iter is not defined in the body of factorial but immediately afterwards. So I think they’re both defined in the global environment. But I think you’re right, if it were defined in the body then it would be a separate environment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s