[plt-scheme] HTDP Section 18 Pragmatics of local, Part 2

From: Emeka (emekamicro at gmail.com)
Date: Wed Apr 22 16:18:51 EDT 2009

The below code is an example from the HTDP (no yelling ). Could someone
explain the highlighted part in detail?  I want something that is detailed
enough because I understand the general idea.

;; last-occurrence : symbol list-of-star  ->  star or false
;; to find the last star record in alostars that contains s in name field
(define (last-occurrence s alostars)
  (cond
    [(empty? alostars) false]
    [else (local ((define r (last-occurrence s (rest alostars))))
            (cond
              [(star? r) r]
              [(symbol=? (star-name (first alostars)) s) (first alostars)]
              [else false]))]))

Thanks in advance.

Regards,
Emeka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090422/19bc739a/attachment.html>

Posted on the users mailing list.