[plt-dev] I love Haskell (not an April Fools Joke!), feature request for 'for'

From: David Vanderson (david.vanderson at gmail.com)
Date: Wed Apr 1 22:39:14 EDT 2009

Matthias Felleisen wrote:
>> (define (fence s n)
>>   (define is (shared ((x (append (range 1 n) (range (- n 1) 2) x))) x))
>>   (define wv (for/list ((c s)) (begin0 (list c (car is)) (set! is (cdr 
>> is)))))
>>   (map first (sort2 wv)))

I very much enjoyed trying my hand at this problem and then figuring out 
how this function works.  But I couldn't find "range" or "sort2" in the 
PLT docs.  Are those functions that seasoned schemers are assumed to 
know about and have on hand?


Posted on the dev mailing list.