Hi everyone,

Currently, "extern mod" links to external crates and "use" performs namespace management. It might be preferable to repurpose "use" for both of these purposes.

So instead of:

    extern mod std;
    use std::json::Json;

You'd write:

    use std::json::Json;

The semantics of this would be that names of external crates form a sort of "outer namespace" one level higher than the root of the crate being compiled. Equivalently, it could be understood as "if regular resolution of a module fails, try to load a crate". This would only work for "use" statements; explicitly-namespace-qualified identifiers would not be eligible for this magic.

This is what Python does, and it seems to work quite well for them.

Thoughts?

Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to