[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: vector-unzip




On Tuesday, April 22, 2003, at 01:22 AM, Michael Burschik wrote:

To quote from the reference implementation:

;; Convenient abbreviations for common unzipping.
(define (vector-unzip1 vec)
  (check-arg vector? vec 'vector-unzip1)
  (vector-unzip vec 0))
(define (vector-unzip2 vec)
  (check-arg vector? vec 'vector-unzip2)
  (vector-unzip vec 1))
(define (vector-unzip3 vec)
  (check-arg vector? vec 'vector-unzip3)
  (vector-unzip vec 2))
(define (vector-unzip4 vec)
  (check-arg vector? vec 'vector-unzip4)
  (vector-unzip vec 3))
(define (vector-unzip5 vec)
  (check-arg vector? vec 'vector-unzip5)
  (vector-unzip vec 5))

This would seem to corroborate my assumption that (vector-unzipn vec) ==
(vector-unzip vec (- n 1)).

But even if I am mistaken, my main point was the definition of
vector-unzip5, which breaks the pattern.

To be more accurate, VECTOR-UNZIP[1-4] were wrong, while VECTOR-UNZIP5 was written correctly. I'll get a new copy of the reference implementation and the
SRFI document up soon, fixing this all.

Regards

Michael Burschik