[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [Chicken-users] Redefinition of imported binding g
From: |
Evan Hanson |
Subject: |
Re: [Chicken-hackers] [Chicken-users] Redefinition of imported binding gets implicitly exported |
Date: |
Sat, 26 Oct 2013 06:51:10 +1300 |
User-agent: |
OpenSMTPD enqueuer (Demoosh) |
Hi Andy, all.
I looked into this recently since it also seemed like a bug to me, but
the behavior seems to be intentional judging from the code.
A workaround is to exclude `process` from the import list in `m` (as in
`(import (except posix ...))`) -- this prevents the behavior you're
seeing, at least.
When `##sys#alias-global-hook` is used to resolve an identifier name for
an assignment, it's called with the already-looked-up name from the
environment and shortcuts when that identifier is already aliased,
returning the imported name (in this case, the built-in `process`)
rather than a new, module-prefixed identifier that would shadow the
binding like you said.
It seems to me that when `##sys#alias-global-hook` is used to resolve
names for `set!` forms, it should be called with the bare
(pre-se-lookup) identifier, and when `assign` is true and you're
currently in a module it should always create a module-prefixed
identifier and update the environment, instead of returning the existing
alias for imported symbols. But, I couldn't get this to work without
breaking other things.
CC'ing -hackers.
Evan
- Re: [Chicken-hackers] [Chicken-users] Redefinition of imported binding gets implicitly exported,
Evan Hanson <=