define wrap-step points define wrap-step-iter ps if null ps wrap-step-

1
2
3
4
5
6
7
8
9
(define (wrap-step p points)
(define (wrap-step-iter q ps)
(if (null? ps)
q
(wrap-step-iter (if (rightturn? p q (car ps))
(car ps)
q)
(cdr ps))))
(wrap-step-iter p points))