I don’t like the glob patterns either, but I might like them more if a module
could define a “prelude” and only those symbols would be imported by a glob
pattern. For example, if you say `use std::str::*`, you would automatically
get the functions but not rarely used things like the raw module.
Maybe just a corruption of existing syntax like:
mymod.rs
```
mod * {
pub use { MyStruct, my_func, MyEnum };
}
pub struct MyStruct {
[…]
}
[…]
```
Eric
On Mar 12, 2014, at 1:57 PM, Daniel Micay <[email protected]> wrote:
> On 12/03/14 06:38 AM, Huon Wilson wrote:
>> Certain aspects of them dramatically complicate the name resolution
>> algorithm (as I understand it), and, anyway, they have various downsides
>> for the actual code, e.g. the equivalent in Python is frowned upon:
>> http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#importing
>>
>> Maybe they aren't so bad in a compiled & statically typed language? I
>> don't know; either way, I personally find code without glob imports
>> easier to read, because I can work out which function is being called
>> very easily, whereas glob imports require more effort.
>>
>>
>> Huon
>
> I think it's still pretty bad. It makes it *very* hard to read the code
> because it's not clear where the names are coming from.
>
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev