[swift-evolution] [pitch] "import" declaration, support for comma-separated modules

Robert Widmann devteam.codafi at gmail.com
Sun Oct 16 02:29:10 CDT 2016


-1.  This is not going to work particularly well with qualified import syntax (import {class|struct|enum|typealias} Module.Decl) and blurs disparate imports with each other.  I'd rather see grouping of related imports than save a few lines.

~Robert Widmann

2016/10/16 3:14、Richard Wei via swift-evolution <swift-evolution at swift.org> のメッセージ:

> +1. Since we can do `let a, b, c, ...`, it makes sense for `import` to support comma-separated lists.
> 
> -Richard
> 
>>> On Oct 15, 2016, at 20:24, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> 
>>> On Oct 15, 2016, at 6:41 PM, Charles Constant via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> How would we all feel about allowing multiple modules with one import statement? 
>>> 
>>> Eg: the option to write
>>> 
>>>     import Cocoa, Foo, Bar.Baz  
>>> 
>>> in addition to just:
>>> 
>>>     import Cocoa   
>>>     import Foo     
>>>     import Bar.Baz 
>>> 
>>> When I'm writing smaller files that import a few modules, I'd  prefer to lump the imports together like this. Doesn't seem like a feature that would require much effort to implement either.
>> 
>> I'm fine with this. I'd also like `import as` to handle namespacing simplification and conflict resolution
>> 
>> `import Bar.Baz as Bif`
>> 
>> -- E
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161016/29366a15/attachment.html>


More information about the swift-evolution mailing list