chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Redefinition of imported binding gets implicitly exporte


From: Andy Bennett
Subject: [Chicken-users] Redefinition of imported binding gets implicitly exported
Date: Fri, 25 Oct 2013 15:09:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hi,

With the following in m.scm:

-----
(module m
 (do-something)

 (import chicken scheme)
 (use posix)

 (define process (make-parameter 'hello))

 (define (do-something)
  (printf "Doing something...\n"))
 )
-----

...and compiled thusly:

csc  -s -O2 -d1 m.scm -j m -o m.so
csc  -s m.import.scm -O2 -d0 -o m.import.so

...on Chicken 4.7.0 or 4.8.0.4 and maybe others,

I get the wrong binding for process when I (use m):

-----
#;1> (use m)
; loading ./m.import.so ...
; loading ./m.so ...
#;2> (process)
hello
-----


...even tho process is not exported from the module m.


Interestingly I wasn't getting this on my development machine but when I
deployed some new code last night I discovered that the binding was
being redefined on the deployment machine even tho' the version of
Chicken was the same. I'm not sure if it has anything to do with the
order in which modules are loaded.

Surely the new definition should shadow the existing one, not redefine it?

The behaviour exists even if the module is imported with a prefix:

-----
#;1> (use (prefix m m:))
; loading ./m.import.so ...
; loading ./m.so ...
#;2> (process)
hello
-----


I'm not sure if this happens with definitions from other eggs rather
than so called "units".


When compiling m.scm -> m.so I get the following warning:

-----
Warning: redefinition of imported value binding: process
-----




Is this behaviour considered a bug?





Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0x7EBA75FF




reply via email to

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