[racket] syntax-parse question

From: Kevin Forchione (lysseus at gmail.com)
Date: Thu Aug 7 22:59:51 EDT 2014

On Aug 7, 2014, at 1:21 PM, Alexander D. Knauth <alexander at knauth.org> wrote:

> By the way would this function version be helpful at all?
> 
> (define (apply* fs lst*)
>   (cond [(empty? fs) lst*]
>         [(not (list? lst*)) lst*]
>         [else
>          (define f (first fs))
>          (define rst (rest fs))
>          (apply f
>                 (for/list ([lst (in-list lst*)])
>                   (apply* rst lst)))]))
> 
> (apply* (list list vector hash)
>         '((1 2 3 4) (5 (6 7) 8)))
> ; '(#(1 2 3 4) #(5 #hash((6 . 7)) 8))

Yes! And extremely instructive. So much to learn!

Thanks!

-Kevin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140807/add38c60/attachment.html>

Posted on the users mailing list.