define gift-wrapping points let minp min-point points define gift-iter

1
2
3
4
5
6
7
8
(define (gift-wrapping points)
(let ((minp (min-point points)))
(define (gift-iterate p res)
(let ((q (wrap-step p points)))
(if (point=? minp p)
(cons p res)
(gift-iterate q (cons res q)))))
(gift-iterate (car points) '())))