chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] string-tokenize and fmt; maybe a module question


From: Felix
Subject: Re: [Chicken-hackers] string-tokenize and fmt; maybe a module question
Date: Fri, 03 Sep 2010 05:41:36 -0400 (EDT)

From: Taylor Venable <address@hidden>
Subject: Re: [Chicken-hackers] string-tokenize and fmt; maybe a module question
Date: Thu, 2 Sep 2010 19:55:55 -0400

> Is that expected behaviour then, if you replace an imported binding inside a
> module, even if you don't re-export it?  A quick check shows that doing it
> at the REPL at least produces a warning, but when using the fmt egg no
> warning was emitted.

Yes, this is expected behaviour. The module system does not create
environments or sets of separate value bindings (this is slightly
different for syntax, but this is not important here), it just
renames. This is not considered a flaw - it is simply how it operates
and is a simple, effective solution to the problem of partioning the
namespace.

If you import a binding, then assignments will change exactly that
binding, regardless of any renaming you do using `import'. As you have
demonstrated, the interpreter will give a note about this.  The
compiler will actually do that as well, if you give it the
`-scrutinize' option (which I recommend to use if possible).

The problem of redefining imported bindings has occurred repeatedly
now (the format-compiler-base extension still has such a bug, IIRC),
so I will turn this into a warning that will always be shown.


cheers,
felix



reply via email to

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