[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Modules and environments
From: |
Peter Bex |
Subject: |
[Chicken-users] Modules and environments |
Date: |
Sun, 30 Aug 2009 15:11:23 +0200 |
User-agent: |
Mutt/1.4.2.3i |
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
pgpi1G0IXvAKD.pgp
Description: PGP signature
- [Chicken-users] Modules and environments,
Peter Bex <=
- Re: [Chicken-users] Modules and environments, Thomas Chust, 2009/08/30
- Re: [Chicken-users] Modules and environments, Peter Bex, 2009/08/30
- Re: [Chicken-users] Modules and environments, Thomas Chust, 2009/08/30
- Re: [Chicken-users] Modules and environments, Peter Bex, 2009/08/30
- Re: [Chicken-users] Modules and environments, Thomas Chust, 2009/08/30
- Re: [Chicken-users] Modules and environments, Peter Bex, 2009/08/30
- Re: [Chicken-users] Modules and environments, Thomas Chust, 2009/08/30
- Re: [Chicken-users] Modules and environments, Peter Bex, 2009/08/30
- Re: [Chicken-users] Modules and environments, Kon Lovett, 2009/08/30
- Re: [Chicken-users] Modules and environments, Peter Bex, 2009/08/30