On 09/12/2012 07:36 AM, Patrick Walton wrote:
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.


I am not crazy about this because it becomes not obvious what 'use' will actually do, and its behavior changes based on what's in scope (and we have some bizarre cross-file scope problems).

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

Reply via email to