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

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


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to