[plt-scheme] How to apply a multi-argument function to each element of a list

From: Barry Brown (barry at cs.sierracollege.edu)
Date: Tue Mar 2 20:45:36 EST 2010

On Mar 2, 2010, at 5:19 PM, Matthias Felleisen wrote:

> 
> 1. Use #lang scheme instead of damn-big-language. 
> 

I see this over and over on the mailing list. I must not have been paying attention when the usage became common. What advantage does "#lang scheme" have over selecting the language from the Language menu?

> 2. I also recommend this pattern: 
> 
> (define (encrypt n m)
>  (local ((define (encrypt-message msg) ... msg ... n ... m ...))
>    encrypt-message))
> 
> (map (encrypt 17 30) (make-list 100000))

The tradeoff here is explaining the "local" syntax instead of the "curry" concept. I'll have to think about which would be more appropriate, since the students have seen neither.

-B

Posted on the users mailing list.