Looking at HTDP-1 
(http://htdp.org/2003-09-26/Book/curriculum-Z-H-25.html#node_chap_19), I see 
this:

(define (filter predicate alon)
  (cond
   [(empty? alon) empty]
   [else (cond
          [(predicate (first alon)) 
           (cons (first alon)
                 (filter predicate (rest alon)))]
          [else
           (filter predicate (rest alon))])]))

Then to find if a member of a list l is below a number i

(define (below i l) 
  (local ((define (below-i x)
            (> i x)))
    (filter below-i l)))

As the proverbial beginner -- who doesn't totally understand closures -- this 
looks like a use of the closure idea. Right? The i is "magically" known in 
`filter`, which seems pretty closure-ish to me. Or am I totally wrong?

LB

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to