<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Is it not as simple as "don't quote the list, use the procedure 'list'?" Procedures are first class.<br><br>Welcome to DrRacket, version 6.0.1 [3m].<br>
Language: racket [custom]; memory limit: 4096 MB.<br>> (define (filter* procs lst)<br> (define (fil ps l)<br> (if (empty? (rest ps))<br> (filter (first ps) l)<br> (fil (rest ps) (filter (first ps) l))))<br>
(if (empty? procs)<br> (error 'filter* "Expected at least one procedure for filtering.")<br> (fil procs lst)))<br>> (define test-list (append (build-list 20 values)<br> (build-list 20 (λ(x) 'derp))))<br>
> (define proc-list (list number? even? (λ(x) (zero? (modulo x 3)))))<br>> (displayln proc-list)<br>(#<procedure:number?> #<procedure:even?> #<procedure>)<br>> (filter* proc-list test-list)<br>'(0 6 12 18)<br>
> <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 12:05 PM, Kevin Forchione <span dir="ltr"><<a href="mailto:lysseus@gmail.com" target="_blank">lysseus@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If I use apply on a list of procedures, the quoting of the list converts the procedures into symbols, which is not what I want to pass to the function supplied to apply (or to map for that matter). What’s the best way to handle this situation?<br>
<br>
-Kevin<br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>