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

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to