[plt-scheme] FFI request: zero-length cvectors

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Feb 15 15:41:54 EST 2007

On Feb 15, jk at xylema.org wrote:
> At the moment attempts to allocate zero-length cvectors fail.  It
> seems to me that this is unschemely, as every other collection type
> I can think of does allow this.

It's an oversight -- `make-cvector' always tries to malloc space for
the items, and malloc does not like to give zero-length blocks.  I
fixed it to avoid mallocing if you want a zero length vector.

(For now, you can use `(cvector <type>)' which will produce zero-size

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.