[racket] reference #:when clause in for/list?

From: Daniel Prager (daniel.a.prager at gmail.com)
Date: Sun Aug 17 08:27:46 EDT 2014

Hi Mark

'in-value' -- which is new to me - thanks Sam! -- is cleaner than using a
'let' (or 'define') outside the for/list, hence preferable.

Re-factoring my earlier example:

(define (mersenne-primes-3 n)
  (for*/list ([i n]
              [c (in-value (sub1 (expt 2 i)))]
              #:when (prime? c))
    (list i c)))

Core Racketeers: Maybe add an 'in-values' example to the docs?

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

Posted on the users mailing list.