Hi all,

I've observed a strange thing with Chicken's modules:

(module test
  (hello)
(import chicken scheme)
(define (hello) (print "hello"))
)
(import test)

(use environments)
(print (environment-has-binding? (interaction-environment) 'hello))

This prints #f, whereas I would have expected it to print #t, since
defining a module and importing should be identical to putting the
module's body in the file. So, this should be identical to the code:

(use environments)
(define (hello) (print "hello"))
(print (environment-has-binding? (interaction-environment) 'hello))

What's wrong here?

By the way,
(print (environment-has-binding? (interaction-environment) 'test#hello))
shows #t, but it does this even without the import.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgpmpEcXI9dXG.pgp
Description: PGP signature

_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to