[plt-scheme] Is there an idiom for throwing away some values?

From: Noel Welsh (noelwelsh at gmail.com)
Date: Tue Jul 28 00:49:46 EDT 2009

On Tue, Jul 28, 2009 at 5:09 AM, Eric Hanchrow<eric.hanchrow at gmail.com> wrote:
>        (for/fold ([sum 0]
>                   [factor 1])

...

I run into this all the time: writing a for/fold where I only want one
value at the end. I've thought about implementing for/fold/first
(returns only the first accumulator) but haven't got around to it.  I
tend to write

(define-values (sum _)
  (for/fold ...))

N.


Posted on the users mailing list.