2009/8/30 Peter Bex <[email protected]>:
> [...]
> (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.
> [...]
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.
Ciao,
Thomas
--
All these theories, diverse as they are, have two things in common: They
explain the observed facts, and they are completely and utterly wrong.
-- Terry Pratchett, "The Light Fantastic"
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users