[gambit-list] Bug

Bradley Lucier lucier at math.purdue.edu
Thu May 10 23:59:36 EDT 2007


This is copied to the Gambit mail list (as was the original message).

On May 10, 2007, at 8:32 PM, Marc Feeley wrote:

> And what makes you think it is OK to
>
> (define (##vector-copy v)
>   (let* ((n (vector-length v))
> 	 (result (make-vector n)))
>     (do ((i (- n 1) (- i 1)))
> 	((< i 0) result)
>       (vector-set! result i (vector-ref v i)))))
>
> "##vector-copy" is supposed to accept any vector-like object as  
> argument, including structures such as readtables.  Just chuck that  
> definition.

So how am I supposed to know that ##vector-copy has been defined  
somewhere in the gambit runtime?  In the main gambc-4.0b22 directory  
I see

> euler-7% grep -r vector-copy `find . -name '*.scm'`
> ./gsc/_gvm.scm:        (left-to-schedule (stretchable-vector-copy  
> (bbs-basic-blocks bbs))))
> ./gsc/_utils.scm:(define (stretchable-vector-copy sv)
> ./gsc/_utils.scm:(define (stretchable-vector-copy sv)
> ./lib/_eval#.scm:  '(##vector (##vector-copy ##step-handlers)
> ./lib/_io.scm:  (let ((copy (##vector-copy rt)))
> ./lib/_io.scm:  (##vector-copy obj))
> ./lib/gambit#.scm:f32vector-copy
> ./lib/gambit#.scm:f64vector-copy
> ./lib/gambit#.scm:s16vector-copy
> ./lib/gambit#.scm:s32vector-copy
> ./lib/gambit#.scm:s64vector-copy
> ./lib/gambit#.scm:s8vector-copy
> ./lib/gambit#.scm:u16vector-copy
> ./lib/gambit#.scm:u32vector-copy
> ./lib/gambit#.scm:u64vector-copy
> ./lib/gambit#.scm:u8vector-copy
> ./lib/gambit#.scm:vector-copy

I presume that there's some macro somewhere that expands to a  
definition of ##vector-copy.  Perhaps the compiler should remark if  
(standard-bindings) or (extended-bindings) are declared and a  
standard or gambit-specific function is (re-)defined in a user file.

Brad



More information about the Gambit-list mailing list