The name `'restricted` is allowed as a shorthand in `require` because
`require` knows what module it's in. The `namespace-attach-module`
function does not try to infer a module context from the namespace
argument; it uses the namespace argument only for its registry. So, you
need to use the full name of the submodule.
The `quote-module-path` form expands to a full name using its syntactic
context (i.e., the enclsoing module's name), so
(namespace-attach-module (namespace-anchor->namespace a)
(quote-module-path restricted)
ns)
is probably what you want.