[r6rs-discuss] "Unspecified"

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Oct 2 12:18:54 EDT 2006


Sam Tobin-Hochstadt <samth at ccs.neu.edu> writes:

> (define (for-each/logging f l)
>     (for-each (lambda (v) (let ([w (f v)]) (display w) (newline) w)) l))

The results of applications of the argument of for-each are ignored;
there is no reason to log them.

If you absolutely want to, you should check the number of results
instead of assuming that there is exactly one result. The argument
of for-each is allowed to return any number of results.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/



More information about the r6rs-discuss mailing list