[r6rs-discuss] "Unspecified"

From: John Cowan <cowan>
Date: Mon Oct 2 11:53:43 2006

Sam Tobin-Hochstadt scripsit:

> > > (for-each/logging (lambda (x) (vector-set! v x)) indexes)
> > >
> > > where:
>
> (define (for-each/logging f l)
> (for-each (lambda (v) (let ([w (f v)]) (display w) (newline) w)) l))
>
> which has the problem I was attempting to point out.

What problem? Adding a proper third argument to "vector-set!", and
defining "v" and "indexes" suitably, causes Chicken at least to simply
print #<unspecified> as many times as there are elements of "indexes".

The behavior is the same if I redefine "vector-set!" to return zero
values, as Chicken coerces zero values to the unspecified value when
a value is required. This is my interpretation of what R6RS requires
as well.

-- 
Barry gules and argent of seven and six,        John Cowan
on a canton azure fifty molets of the second.   cowan_at_ccil.org
        --blazoning the U.S. flag               http://www.ccil.org/~cowan
Received on Mon Oct 02 2006 - 11:53:13 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC