reset password
Author Message
Amedrano
Posts: 80
Posted 13:40 Nov 14, 2015 |

NOTE: This makes a function call to get a function, which is then called! Be sure you understand the italicized parts.

(define (render world-state)
  (let* ([mo1 (first world-state)]
         [mo2 (second world-state)]
         )
    ((moving-object-renderer mo2) mo2 
                                  ((moving-object-renderer mo1) mo1 IMAGE0)image1)))

When abstracting out the render function in notes week 5 I get an unbound identifier error at "image1" above.  Anyone else have this problem?

rabbott
Posts: 1649
Posted 13:53 Nov 14, 2015 |

The wiki seems to be down -- or at least I can't get to it. So I can't look it up.

If it really says what you quote, it looks like a typo from a previous way of writing that function.

The alternative could have been.

(define (render world-state)
  (let* ([mo1 (first world-state)]
         [mo2 (second world-state)]
         [image1 ((moving-object-renderer mo1) mo1 IMAGE0)]
         )
    ((moving-object-renderer mo2) mo2 image1)))

What you quote should have substituted ((moving-object-renderer mo1) mo1 IMAGE0) for image1 in the last line and dropped image1.

Last edited by rabbott at 14:00 Nov 14, 2015.
Amedrano
Posts: 80
Posted 13:58 Nov 14, 2015 |

Thanks Dr.Abbott makes much more sense now!