Yes, but you can minimize the risk.  Particularly if you are importing your own 
modules.  Just need to use some common sense.

If you are referring to importing at the block level, I see a lot of Rust code 
doing that including in the compiler.  Glob imports are not really used though. 
 Like most people, I’m not sure how I feel about them yet.

Eric

On Mar 12, 2014, at 2:45 PM, Bob Ippolito <[email protected]> wrote:

> Is that what people actually do? You still risk breakage if you glob import 
> from two or more modules in the same block.
> 
> 
> On Wed, Mar 12, 2014 at 12:22 PM, Eric Summers <[email protected]> wrote:
> 
> Fixed ;-)
> 
> On Mar 12, 2014, at 2:19 PM, Eric Summers <[email protected]> wrote:
> 
>> I think it helps that Rust allows imports in any block.  You could use glob 
>> imports like this with less risk of breaking:
>> 
>> ```
>> fn foo() {
>>      use std::str::*
>>      [..]
>> }
>> ```
>> 
>> Eric
>> 
>> 
>> On Mar 12, 2014, at 2:17 PM, Bob Ippolito <[email protected]> wrote:
>> 
>>> Glob imports work well up front but aren't good for maintenance. In Haskell 
>>> if a popular library adds a new function it could easily break any packages 
>>> that depend on it that use glob imports. It's more work but almost always 
>>> best to explicitly import individual names. A tool could help with this 
>>> though. 
>>> 
>>> On Wednesday, March 12, 2014, Huon Wilson <[email protected]> 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
>>> 
>>> On 12/03/14 20:44, Liigo Zhuang wrote:
>>>> "glob use" just make compiler loading more types, but make programmers a 
>>>> lot easy (to write, to remember). perhaps I'm wrong? thank you!
>>>> 
>>>> -- 
>>>> by Liigo, http://blog.csdn.net/liigo/
>>>> Google+  https://plus.google.com/105597640837742873343/
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 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
>> 
>> _______________________________________________
>> 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

Reply via email to