[racket] reference #:when clause in for/list?
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?
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140817/b42d281d/attachment-0001.html>