chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] r7rs improper redefinition of imported symbol


From: John J Foerch
Subject: [Chicken-users] r7rs improper redefinition of imported symbol
Date: Mon, 19 Sep 2016 16:51:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hello,

I ran into a little problem when working with the r6rs-bytevectors egg,
which provides an r7rs implementation of (r6rs bytevectors).  The
bytevector-copy! procedure has a different call signature in r6 than in
r7, and I found that as r6rs-bytevectors is currently written, its
bytevector-copy! always shadows or overrides the bytevector-copy! from
r7rs.  In order to see exactly what's going on, I made a simple test
case that does not using the r6rs-bytevectors egg, but instead using a
minimal module that illustrates the problem:

;;;; moduleb.sld

    (define-library (moduleb)
      (export bytevector-copy!)

      (import (except (scheme base) bytevector-copy!)
              (scheme write))

      (begin
        (define (bytevector-copy! to at from start end)
          (display "derp\n")))

    )

;;;; import-except-test.scm

    (import chicken scheme)

    (use r7rs)

    (load "moduleb.sld")

    (define dst (make-bytevector 10 0))

    (define src (make-bytevector 10 1))

    (bytevector-copy! dst 0 src 8 10)

    (print dst)

;;;; shell session

    $ csi -s import-except-test.scm 

    Warning: redefinition of imported value binding: bytevector-copy!
    derp
    #u8(0 0 0 0 0 0 0 0 0 0)

Note that import-except-test.scm does not import moduleb, it only loads
the sld.

When I made an equivalent test using a chicken (module ...) form instead
of an r7rs define-library form, I did not encounter the redefinition
problem.

This looks like a bug in chicken's r7rs egg to me, but is it?  Should
moduleb (and r6rs-bytevectors) be written differently to avoid this
problem?

Thank you,

John Foerch




reply via email to

[Prev in Thread] Current Thread [Next in Thread]