[plt-scheme] 'unspecified' arguemnt of make-vector

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Wed Feb 23 04:55:08 EST 2005

Zhu Chongkai wrote:

> R5RS says:
> procedure: (make-vector k)
> procedure: (make-vector k fill)
> Returns a newly allocated vector of k elements. If a second argument is given, 
 > then each element is initialized to fill. Otherwise the initial contents of each
 > element is unspecified.

>>(make-vector 1 (if #f #f))
> #(#<void>)
>>(make-vector 3)
> #(0 0 0)

> Should PLT-Scheme use (void) instead of 0 in the 'unspecified' case?
> Or could anyone tell why 0 is better?

First, R5RS doesn't specify what to fill in thus filling with zeros follows
the specification.

Second, the specification of MzScheme states that the filler should be


An PLT using other routines than from the srfi would be very surprised
if the normal behaviour of make-vector suddenly changed.

The rationale behind using zero as filler is probably that
most people use vectors of zeros more often than vectors of the invisble

Jens Axel Søgaard

Posted on the users mailing list.