chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Modules and environments


From: Kon Lovett
Subject: Re: [Chicken-users] Modules and environments
Date: Sun, 30 Aug 2009 10:27:26 -0700


On Aug 30, 2009, at 10:04 AM, Peter Bex wrote:

On Sun, Aug 30, 2009 at 04:42:43PM +0200, Thomas Chust wrote:
Hello,

I think importing a module and pasting its code into another context
are not equivalent: The module definition itself sets up bindings in
the environment while the import establishes a mapping between
identifiers used in the code and in the execution environment. This
mapping is purely syntactic and can't be queried by examining the
runtime content of the environment datastructure.

This sounds like a bug to me; the identifiers are certainly available to code running in that environment. Why shouldn't one be able to observe
the fact that they are?

Not a bug. Chicken does not have 1st-class binding-environments. Felix is not a believer. The "environments" extension is tolerated but not endorsed. As an example, the "apropos" extension does not use the "environments" extension but instead relies on undocumented calls.

I suggest re-opening the debate.


If (print (environment-has-binding? (interaction-environment) 'hello))
shows #f, then I would expect (eval '(hello) (interaction- environment))
to fail, but it simply prints "hello".

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
_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon






reply via email to

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